Plugin Directory

Changeset 1360411


Ignore:
Timestamp:
02/29/2016 01:28:53 AM (10 years ago)
Author:
sparkpost
Message:

Update to version 1.1.5

Location:
sparkpost
Files:
5 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • sparkpost/trunk/mailer.class.php

    r1326652 r1360411  
    1414    {
    1515        add_action('phpmailer_init', array($this, 'configure_phpmailer'), 2);
     16        add_filter('wp_mail_from', array($this, 'set_from_email'));
     17        add_filter('wp_mail_from_name', array($this, 'set_from_name'));
    1618    }
    1719
     
    2527        $phpmailer->isSMTP();
    2628        $phpmailer->SMTPSecure = 'tls';
    27         $phpmailer->Port = 587;
     29        $phpmailer->Port = !empty($options['port']) ? intval($options['port']) : 587;
    2830        $phpmailer->Host = 'smtp.sparkpostmail.com';
    29         $phpmailer->setFrom($options['from_email'], $options['from_name']);
    3031        $phpmailer->AddReplyTo($options['from_email'], $options['from_name']);
    3132       
     
    3435        $phpmailer->Password = $options['password'];
    3536    }
     37
     38    public function set_from_name() {
     39        $options = get_option('sp_settings');
     40        return $options['from_name'];
     41    }
     42
     43    public function set_from_email() {
     44        $options = get_option('sp_settings');
     45        return $options['from_email'];
     46    }
    3647}
  • sparkpost/trunk/readme.txt

    r1326844 r1360411  
    33Tags: sparkpost, smtp, wp_mail, mail, email
    44Requires at least: 4.0
    5 Tested up to: 4.4
    6 Stable tag: 1.1.4
     5Tested up to: 4.4.2
     6Stable tag: 1.1.5
    77License: GPLv2 or later
    88
     
    6262
    6363== Changelog ==
     64= 1.1.5 =
     65- Support alternate port
     66- Use filter to set sender info
     67- Clearer settings panel
     68
    6469= 1.1.4 =
    65 Minor settings update
     70Update copy
    6671
    6772= 1.1.3 =
  • sparkpost/trunk/sparkpost.class.php

    r1326652 r1360411  
    2525            'from_name' => '',
    2626            'from_email' => '',
     27            'port' => 587,
    2728            'enable_sparkpost' => 0
    2829            );
  • sparkpost/trunk/widget.class.php

    r1326840 r1360411  
    8989                    settings_fields("sp_settings_group");
    9090                    do_settings_sections("sp-options");
     91                    do_settings_sections("sp-advanced");
    9192                    submit_button();
    9293                ?>
     
    119120        add_settings_field("from_name", "From name*", array($this, 'render_from_name_field'), "sp-options", "general");
    120121        add_settings_field("from_email", "From email*", array($this, 'render_from_email_field'), "sp-options", "general");
     122       
     123        add_settings_field("username", "Username*", array($this, 'render_username_field'), "sp-options", "general");
    121124        add_settings_field("password", "Password*", array($this, 'render_password_field'), "sp-options", "general");
     125
     126        add_settings_section('advanced', 'Advanced', null, "sp-advanced");
     127        add_settings_field("port", "Port", array($this, 'render_port_field'), "sp-advanced", "advanced");
    122128
    123129        add_settings_section('test_email', '', null, 'sp-test-email');
     
    149155        }
    150156
    151         if(isset($input['enable_sparkpost'])) {
     157        if (isset($input['enable_sparkpost'])) {
    152158            $new_input['enable_sparkpost'] = 1;
    153159        } else {
     
    160166        }
    161167
     168        $new_input['port'] = in_array(intval(esc_attr($input['port'])), array(587, 2525)) ? intval(esc_attr($input['port'])) : 587;
     169
    162170        return $new_input;
    163171    }
     
    168176            '<label><input type="checkbox" id="enable_sparkpost" name="sp_settings[enable_sparkpost]" value="1" %s />Send email using SparkPost</label>', $this->options['enable_sparkpost'] ? 'checked' : ''
    169177        );
     178    }
     179
     180    public function render_username_field()
     181    {
     182        echo '<input type="text" id="username" name="sp_settings[username]" class="regular-text" value="SMTP_Injection" readonly />';
    170183    }
    171184
     
    194207    }
    195208
     209    public function render_port_field()
     210    {
     211        $selected_port = esc_attr($this->options['port']);
     212
     213        echo '<select name="sp_settings[port]">
     214        <option value="587" ' . (($selected_port == 587) ? 'selected' : '') . '>587 (Default)</option>
     215        <option value="2525" ' .(($selected_port == 2525) ? 'selected' : '') .'>2525</option>
     216        </select><br/><small>Change only if default port is not working!</small>';
     217    }
     218
    196219    public function render_to_email_field()
    197220    {
  • sparkpost/trunk/wordpress-sparkpost.php

    r1326844 r1360411  
    77Plugin URI: http://sparkpost.com/
    88Description: Send all your email from Wordpress through SparkPost, the world's most advanced email delivery service.
    9 Version: 1.1.4
    10 Author: The HungryCoder
    11 Author URI: http://thehungrycoder.com
     9Version: 1.1.5
     10Author: SparkPost
     11Author URI: http://sparkpost.com
    1212License: GPLv2 or later
    1313Text Domain: wpsp
Note: See TracChangeset for help on using the changeset viewer.