SendGrid - Version 1.6.4

Version Description

  • Add support for toName in API method, Add required Text Domain
Download this release

Release Info

Developer team-rs
Plugin Icon 128x128 SendGrid
Version 1.6.4
Comparing to
See all releases

Code changes from version 1.6.3 to 1.6.4

Files changed (3) hide show
  1. lib/overwrite-sendgrid-methods.php +16 -11
  2. readme.txt +5 -1
  3. wpsendgrid.php +2 -1
lib/overwrite-sendgrid-methods.php CHANGED
@@ -340,17 +340,16 @@ if ( ! function_exists('wp_mail'))
340
  }
341
  }
342
  }
343
-
344
- if ( ( 'api' == $method ) and ( count( $cc ) or count( $bcc ) ) )
 
345
  {
346
- foreach ( (array) $to as $key => $recipient )
 
347
  {
348
- // Break $recipient into name and address parts if in the format "Foo <bar@baz.com>"
349
- if ( preg_match( '/(.*)<(.+)>/', $recipient, $matches ) )
350
- {
351
- if ( 3 == count( $matches ) ) {
352
- $to[ $key ] = trim( $matches[2] );
353
- }
354
  }
355
  }
356
  }
@@ -361,12 +360,18 @@ if ( ! function_exists('wp_mail'))
361
 
362
  $content_type = apply_filters( 'wp_mail_content_type', $content_type );
363
 
364
- $mail->setTos( $to )
365
- ->setSubject( $subject )
366
  ->setText( $message )
367
  ->addCategory( SENDGRID_CATEGORY )
368
  ->setFrom( $from_email );
369
 
 
 
 
 
 
 
 
370
  $categories = explode( ',', Sendgrid_Tools::get_categories() );
371
  foreach ($categories as $category)
372
  {
340
  }
341
  }
342
  }
343
+
344
+ $toname = array();
345
+ foreach ( (array) $to as $key => $recipient )
346
  {
347
+ // Break $recipient into name and address parts if in the format "Foo <bar@baz.com>"
348
+ if ( preg_match( '/(.*)<(.+)>/', $recipient, $matches ) )
349
  {
350
+ if ( 3 == count( $matches ) ) {
351
+ $to[ $key ] = trim( $matches[2] );
352
+ $toname[ $key ] = trim( $matches[1] );
 
 
 
353
  }
354
  }
355
  }
360
 
361
  $content_type = apply_filters( 'wp_mail_content_type', $content_type );
362
 
363
+ $mail->setSubject( $subject )
 
364
  ->setText( $message )
365
  ->addCategory( SENDGRID_CATEGORY )
366
  ->setFrom( $from_email );
367
 
368
+ if ( 'api' == $method ) {
369
+ $mail->addTo( $to , $toname );
370
+ }
371
+ else {
372
+ $mail->addTo( $to );
373
+ }
374
+
375
  $categories = explode( ',', Sendgrid_Tools::get_categories() );
376
  foreach ($categories as $category)
377
  {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://sendgrid.com/
4
  Tags: email, email reliability, email templates, sendgrid, smtp, transactional email, wp_mail,email infrastructure, email marketing, marketing email, deliverability, email deliverability, email delivery, email server, mail server, email integration, cloud email
5
  Requires at least: 3.3
6
  Tested up to: 4.3
7
- Stable tag: 1.6.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -123,6 +123,8 @@ Create a SendGrid account at <a href="http://sendgrid.com/partner/wordpress" tar
123
 
124
  == Changelog ==
125
 
 
 
126
  = 1.6.3 =
127
  * Update Smtp class name to avoid conflicts
128
  = 1.6.2 =
@@ -178,6 +180,8 @@ Create a SendGrid account at <a href="http://sendgrid.com/partner/wordpress" tar
178
 
179
  == Upgrade notice ==
180
 
 
 
181
  = 1.6.3 =
182
  * Update Smtp class name to avoid conflicts
183
  = 1.6.2 =
4
  Tags: email, email reliability, email templates, sendgrid, smtp, transactional email, wp_mail,email infrastructure, email marketing, marketing email, deliverability, email deliverability, email delivery, email server, mail server, email integration, cloud email
5
  Requires at least: 3.3
6
  Tested up to: 4.3
7
+ Stable tag: 1.6.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
123
 
124
  == Changelog ==
125
 
126
+ = 1.6.4 =
127
+ * Add support for toName in API method, Add required Text Domain
128
  = 1.6.3 =
129
  * Update Smtp class name to avoid conflicts
130
  = 1.6.2 =
180
 
181
  == Upgrade notice ==
182
 
183
+ = 1.6.4 =
184
+ * Add support for toName in API method, Add required Text Domain
185
  = 1.6.3 =
186
  * Update Smtp class name to avoid conflicts
187
  = 1.6.2 =
wpsendgrid.php CHANGED
@@ -3,9 +3,10 @@
3
  Plugin Name: SendGrid
4
  Plugin URI: http://wordpress.org/plugins/sendgrid-email-delivery-simplified/
5
  Description: Email Delivery. Simplified. SendGrid's cloud-based email infrastructure relieves businesses of the cost and complexity of maintaining custom email systems. SendGrid provides reliable delivery, scalability and real-time analytics along with flexible APIs that make custom integration a breeze.
6
- Version: 1.6.3
7
  Author: SendGrid
8
  Author URI: http://sendgrid.com
 
9
  License: GPLv2
10
  */
11
 
3
  Plugin Name: SendGrid
4
  Plugin URI: http://wordpress.org/plugins/sendgrid-email-delivery-simplified/
5
  Description: Email Delivery. Simplified. SendGrid's cloud-based email infrastructure relieves businesses of the cost and complexity of maintaining custom email systems. SendGrid provides reliable delivery, scalability and real-time analytics along with flexible APIs that make custom integration a breeze.
6
+ Version: 1.6.4
7
  Author: SendGrid
8
  Author URI: http://sendgrid.com
9
+ Text Domain: sendgrid-email-delivery-simplified
10
  License: GPLv2
11
  */
12