Plugin Directory

Changeset 1597499


Ignore:
Timestamp:
02/16/2017 07:09:23 PM (9 years ago)
Author:
sparkpost
Message:

Release v2.6.4

Location:
sparkpost/trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • sparkpost/trunk/admin.widget.class.php

    r1582798 r1597499  
    5252    {
    5353        add_filter('wp_mail_content_type', array($this, 'set_html_content_type'));
     54        $headers = array();
     55        $attachments= array(__DIR__ . '/sample.txt');
    5456        $result = wp_mail($recipient,
    5557            'SparkPost email test',
    5658            '<h3>Hurray!!</h3><p>You\'ve got mail! <br/><br> Regards,<br/><a href="https://www.sparkpost.com">SparkPost</a> WordPress plugin</p>',
    57             ''
     59            $headers,
     60            $attachments
    5861        );
    5962        remove_filter('wp_mail_content_type', array($this, 'set_html_content_type'));
     
    243246        <small>
    244247            <ul>
    245                 <li>- Please see <a href="https://support.sparkpost.com/customer/portal/articles/2409547-using-templates-with-the-sparkpost-wordpress-plugin">this article</a> for detailed information about using templates with this plugin.</li>
     248                <li>- Please see <a href="https://support.sparkpost.com/customer/portal/articles/2409547-using-templates-with-the-sparkpost-wordpress-plugin" target="_blank">this article</a> for detailed information about using templates with this plugin.</li>
    246249                <li>- Templates can only be used with the HTTP API.</li>
    247                 <li>- Leave this field blank to disable use of a template.</li>
     250                <li>- <a href="https://github.com/SparkPost/wordpress-sparkpost/blob/master/docs/templates-attachments.md" target="_blank">Does not work with attachment.</a>
     251                <li>- Leave this field blank to disable use of a template. You can still specify it by <a href="https://github.com/SparkPost/wordpress-sparkpost/blob/master/docs/hooks.md" target="_blank">using hooks</a>.</li>
    248252            </ul>
    249253        </small>
  • sparkpost/trunk/mailer.http.class.php

    r1582798 r1597499  
    8787        );
    8888
     89        $template_id = apply_filters('wpsp_template_id', $this->settings['template']);
     90
    8991        // pass through either stored template or inline content
    90         if (!empty($this->settings['template'])) {
     92        if (!empty($template_id)) {
    9193            // stored template
    92             $body['content']['template_id'] = apply_filters('wpsp_template_id', $this->settings['template']);
     94            $body['content']['template_id'] = $template_id;
    9395
    9496            // supply substitution data so users can add variables to templates
     
    9698            $body['substitution_data']['subject'] = $this->Subject;
    9799            $body['substitution_data']['from_name'] = $sender['name'];
    98             $body['substitution_data']['from'] = $sender['name'] . ' <' . $sender['email'] . '>';
     100            $body['substitution_data']['from'] = $sender['email'];
    99101            if ($replyTo) {
    100102                $body['substitution_data']['reply_to'] = $replyTo;
  • sparkpost/trunk/readme.txt

    r1587288 r1597499  
    44Requires at least: 4.3
    55Tested up to: 4.7.2
    6 Stable tag: 2.6.3
     6Stable tag: 2.6.4
    77License: GPLv2 or later
    88
     
    4747
    4848== Changelog ==
     49= 2.6.4 =
     50- Fix the issue to use template hook when not set in settings ([#95](https://github.com/SparkPost/wordpress-sparkpost/issues/95))
     51- Clarify attachment can't be sent with template and include workaround example ([#96](https://github.com/SparkPost/wordpress-sparkpost/issues/96))
     52- Include attachment in test email
     53
    4954= 2.6.3 =
    5055- Add plugin name to XMailer (for SMTP)
     
    120125== Upgrade Notice ==
    121126
    122 From WordPress plugins list, click `update now`. 
     127From WordPress plugins list, click `update now`.
  • sparkpost/trunk/tests/specs/test-mailer.http.class.php

    r1582798 r1597499  
    204204    NSA::setProperty($this->mailer, 'settings', [
    205205      'enable_tracking' => true,
    206       'transactional' => false
     206      'transactional' => false,
     207      'template' => ''
    207208    ]);
    208209
     
    260261  }
    261262
     263  function test_get_request_body_template_in_hook_but_not_in_settings() {
     264    $this->mailer->addAddress('[email protected]', 'abc');
     265    $this->mailer->setFrom( '[email protected]', 'me');
     266
     267    $callback = function(){
     268      return 'test-template';
     269    };
     270
     271    add_filter('wpsp_template_id', $callback);
     272
     273    NSA::setProperty($this->mailer, 'settings', [
     274      'enable_tracking' => true,
     275      'transactional' => false,
     276      'template' => ''
     277    ]);
     278
     279    $body = NSA::invokeMethod($this->mailer, 'get_request_body');
     280    remove_filter('wpsp_template_id', $callback);
     281    $this->assertTrue($body['content']['template_id'] == 'test-template');
     282  }
     283
    262284  function test_get_request_body_with_template() {
    263285    $this->mailer->addAddress('[email protected]', 'abc');
     
    305327        'subject' => '',
    306328        'from_name' => 'me',
    307         'from' => 'me <[email protected]>',
     329        'from' => 'me@hello.com',
    308330        'from_localpart'  => 'me'
    309331      ]
  • sparkpost/trunk/wordpress-sparkpost.php

    r1587288 r1597499  
    55Plugin URI: http://sparkpost.com/
    66Description: Send all your email from Wordpress through SparkPost, the world's most advanced email delivery service.
    7 Version: 2.6.3
     7Version: 2.6.4
    88Author: SparkPost
    99Author URI: http://sparkpost.com
     
    1818define('WPSP_PLUGIN_DIR', plugin_dir_path(__FILE__));
    1919define('WPSP_PLUGIN_PATH', WPSP_PLUGIN_DIR . basename(__FILE__));
    20 define('WPSP_PLUGIN_VERSION', '2.6.3');
     20define('WPSP_PLUGIN_VERSION', '2.6.4');
    2121
    2222require_once(WPSP_PLUGIN_DIR . 'sparkpost.class.php');
Note: See TracChangeset for help on using the changeset viewer.