Changeset 1597499
- Timestamp:
- 02/16/2017 07:09:23 PM (9 years ago)
- Location:
- sparkpost/trunk
- Files:
-
- 2 added
- 5 edited
-
admin.widget.class.php (modified) (2 diffs)
-
docs/templates-attachments.md (added)
-
mailer.http.class.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
sample.txt (added)
-
tests/specs/test-mailer.http.class.php (modified) (3 diffs)
-
wordpress-sparkpost.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sparkpost/trunk/admin.widget.class.php
r1582798 r1597499 52 52 { 53 53 add_filter('wp_mail_content_type', array($this, 'set_html_content_type')); 54 $headers = array(); 55 $attachments= array(__DIR__ . '/sample.txt'); 54 56 $result = wp_mail($recipient, 55 57 'SparkPost email test', 56 58 '<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 58 61 ); 59 62 remove_filter('wp_mail_content_type', array($this, 'set_html_content_type')); … … 243 246 <small> 244 247 <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> 246 249 <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> 248 252 </ul> 249 253 </small> -
sparkpost/trunk/mailer.http.class.php
r1582798 r1597499 87 87 ); 88 88 89 $template_id = apply_filters('wpsp_template_id', $this->settings['template']); 90 89 91 // pass through either stored template or inline content 90 if (!empty($t his->settings['template'])) {92 if (!empty($template_id)) { 91 93 // stored template 92 $body['content']['template_id'] = apply_filters('wpsp_template_id', $this->settings['template']);94 $body['content']['template_id'] = $template_id; 93 95 94 96 // supply substitution data so users can add variables to templates … … 96 98 $body['substitution_data']['subject'] = $this->Subject; 97 99 $body['substitution_data']['from_name'] = $sender['name']; 98 $body['substitution_data']['from'] = $sender[' name'] . ' <' . $sender['email'] . '>';100 $body['substitution_data']['from'] = $sender['email']; 99 101 if ($replyTo) { 100 102 $body['substitution_data']['reply_to'] = $replyTo; -
sparkpost/trunk/readme.txt
r1587288 r1597499 4 4 Requires at least: 4.3 5 5 Tested up to: 4.7.2 6 Stable tag: 2.6. 36 Stable tag: 2.6.4 7 7 License: GPLv2 or later 8 8 … … 47 47 48 48 == 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 49 54 = 2.6.3 = 50 55 - Add plugin name to XMailer (for SMTP) … … 120 125 == Upgrade Notice == 121 126 122 From WordPress plugins list, click `update now`. 127 From WordPress plugins list, click `update now`. -
sparkpost/trunk/tests/specs/test-mailer.http.class.php
r1582798 r1597499 204 204 NSA::setProperty($this->mailer, 'settings', [ 205 205 'enable_tracking' => true, 206 'transactional' => false 206 'transactional' => false, 207 'template' => '' 207 208 ]); 208 209 … … 260 261 } 261 262 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 262 284 function test_get_request_body_with_template() { 263 285 $this->mailer->addAddress('[email protected]', 'abc'); … … 305 327 'subject' => '', 306 328 'from_name' => 'me', 307 'from' => 'me <[email protected]>',329 'from' => 'me@hello.com', 308 330 'from_localpart' => 'me' 309 331 ] -
sparkpost/trunk/wordpress-sparkpost.php
r1587288 r1597499 5 5 Plugin URI: http://sparkpost.com/ 6 6 Description: Send all your email from Wordpress through SparkPost, the world's most advanced email delivery service. 7 Version: 2.6. 37 Version: 2.6.4 8 8 Author: SparkPost 9 9 Author URI: http://sparkpost.com … … 18 18 define('WPSP_PLUGIN_DIR', plugin_dir_path(__FILE__)); 19 19 define('WPSP_PLUGIN_PATH', WPSP_PLUGIN_DIR . basename(__FILE__)); 20 define('WPSP_PLUGIN_VERSION', '2.6. 3');20 define('WPSP_PLUGIN_VERSION', '2.6.4'); 21 21 22 22 require_once(WPSP_PLUGIN_DIR . 'sparkpost.class.php');
Note: See TracChangeset
for help on using the changeset viewer.