SendGrid - Version 1.11.4

Version Description

  • Fixed an issue where TO field recipients could not see each other in the email header
Download this release

Release Info

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

Code changes from version 1.11.3 to 1.11.4

lib/class-sendgrid-tools.php CHANGED
@@ -1262,7 +1262,7 @@ class Sendgrid_Tools
1262
  case 'x-smtpapi-to':
1263
  $xsmtpapi_tos = explode( ',', trim( $content ) );
1264
  foreach ( $xsmtpapi_tos as $xsmtpapi_to ) {
1265
- if( ! Sendgrid_Tools::is_valid_email( $xsmtpapi_to ) ) {
1266
  return false;
1267
  }
1268
  }
1262
  case 'x-smtpapi-to':
1263
  $xsmtpapi_tos = explode( ',', trim( $content ) );
1264
  foreach ( $xsmtpapi_tos as $xsmtpapi_to ) {
1265
+ if( ! Sendgrid_Tools::is_valid_email( trim( $xsmtpapi_to ) ) ) {
1266
  return false;
1267
  }
1268
  }
lib/sendgrid/class-sendgrid-translator.php CHANGED
@@ -181,6 +181,9 @@ class Sendgrid_Translator {
181
  return;
182
  }
183
 
 
 
 
184
  foreach ( $email_v2->to as $index => $address ) {
185
  if ( ! self::is_valid_string( $address ) ) {
186
  continue;
@@ -189,25 +192,22 @@ class Sendgrid_Translator {
189
  $to_name = null;
190
  $to_address = trim( $address );
191
 
192
- if ( isset( $email_v2->toName[ $index ] ) and
193
  self::is_valid_string( $email_v2->toName[ $index ] ) ) {
194
  $to_name = trim( $email_v2->toName[ $index ] );
195
  }
196
 
197
  $recipient = new SendGridV3\Email( $to_name, $to_address );
198
 
199
- // Create a new personalization for this To
200
- $personalization = new SendGridV3\Personalization();
201
-
202
  // Add the values
203
  $personalization->addTo( $recipient );
204
  self::set_substitutions_v3( $index, $personalization, $email_v2 );
205
  self::set_custom_args_v3( $index, $personalization, $email_v2 );
206
  self::set_send_each_at_v3( $index, $personalization, $email_v2 );
207
-
208
- // Append the personalization to the email
209
- $email_v3->addPersonalization( $personalization );
210
  }
 
 
 
211
  }
212
 
213
  /**
181
  return;
182
  }
183
 
184
+ // Create a new personalization for this To
185
+ $personalization = new SendGridV3\Personalization();
186
+
187
  foreach ( $email_v2->to as $index => $address ) {
188
  if ( ! self::is_valid_string( $address ) ) {
189
  continue;
192
  $to_name = null;
193
  $to_address = trim( $address );
194
 
195
+ if ( isset( $email_v2->toName[ $index ] ) and
196
  self::is_valid_string( $email_v2->toName[ $index ] ) ) {
197
  $to_name = trim( $email_v2->toName[ $index ] );
198
  }
199
 
200
  $recipient = new SendGridV3\Email( $to_name, $to_address );
201
 
 
 
 
202
  // Add the values
203
  $personalization->addTo( $recipient );
204
  self::set_substitutions_v3( $index, $personalization, $email_v2 );
205
  self::set_custom_args_v3( $index, $personalization, $email_v2 );
206
  self::set_send_each_at_v3( $index, $personalization, $email_v2 );
 
 
 
207
  }
208
+
209
+ // Append the personalization to the email
210
+ $email_v3->addPersonalization( $personalization );
211
  }
212
 
213
  /**
lib/sendgrid/sendgrid-wp-mail.php CHANGED
@@ -193,7 +193,7 @@ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array()
193
  case 'x-smtpapi-to':
194
  $xsmtpapi_tos = explode( ',', trim( $content ) );
195
  foreach ( $xsmtpapi_tos as $xsmtpapi_to ) {
196
- $mail->addSmtpapiTo( $xsmtpapi_to );
197
  }
198
  break;
199
  case 'substitutions':
193
  case 'x-smtpapi-to':
194
  $xsmtpapi_tos = explode( ',', trim( $content ) );
195
  foreach ( $xsmtpapi_tos as $xsmtpapi_to ) {
196
+ $mail->addSmtpapiTo( trim( $xsmtpapi_to ) );
197
  }
198
  break;
199
  case 'substitutions':
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: team-rs
3
  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: 4.6
6
- Tested up to: 4.7
7
- Stable tag: 1.11.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -250,6 +250,24 @@ The settings for all sites in the network can be configured only by the Network
250
 
251
  Since 1.10.5 the Network Admin can delegate the configuration for each subsite to their respective owners. This will allow any subsite to use it's own SendGrid Plugin configuration.
252
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  == Screenshots ==
254
 
255
  1. Go to Admin Panel, section Plugins and activate the SendGrid plugin. If you want to send emails through SMTP you need to install also the 'Swift Mailer' plugin.
@@ -266,6 +284,8 @@ Since 1.10.5 the Network Admin can delegate the configuration for each subsite t
266
 
267
  == Changelog ==
268
 
 
 
269
  = 1.11.3 =
270
  * Fixed an issue where the send test form was displayed when no API key was set
271
  * Fixed an issue where the subscription test form was not displayed for the default contact list
@@ -438,6 +458,8 @@ Since 1.10.5 the Network Admin can delegate the configuration for each subsite t
438
 
439
  == Upgrade notice ==
440
 
 
 
441
  = 1.11.3 =
442
  * Fixed an issue where the send test form was displayed when no API key was set
443
  * Fixed an issue where the subscription test form was not displayed for the default contact list
3
  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: 4.6
6
+ Tested up to: 4.8
7
+ Stable tag: 1.11.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
250
 
251
  Since 1.10.5 the Network Admin can delegate the configuration for each subsite to their respective owners. This will allow any subsite to use it's own SendGrid Plugin configuration.
252
 
253
+ = How can I further customize my emails? =
254
+
255
+ When calling the wp_mail() function you can send a SendGrid PHP email object in the headers argument.
256
+
257
+ Here is an example:
258
+
259
+ `$email = new SendGrid\Email();
260
+ $email
261
+ ->setFrom('me@bar.com')
262
+ ->setHtml('<strong>Hello World!</strong>')
263
+ ->addCategory('customCategory')
264
+ ;
265
+
266
+ wp_mail('foo@bar.com', 'Subject goes here', 'Message goes here', $email);
267
+ `
268
+
269
+ You can find more examples here: https://github.com/sendgrid/sendgrid-php/blob/v4.0.2/README.md
270
+
271
  == Screenshots ==
272
 
273
  1. Go to Admin Panel, section Plugins and activate the SendGrid plugin. If you want to send emails through SMTP you need to install also the 'Swift Mailer' plugin.
284
 
285
  == Changelog ==
286
 
287
+ = 1.11.4 =
288
+ * Fixed an issue where TO field recipients could not see each other in the email header
289
  = 1.11.3 =
290
  * Fixed an issue where the send test form was displayed when no API key was set
291
  * Fixed an issue where the subscription test form was not displayed for the default contact list
458
 
459
  == Upgrade notice ==
460
 
461
+ = 1.11.4 =
462
+ * Fixed an issue where TO field recipients could not see each other in the email header
463
  = 1.11.3 =
464
  * Fixed an issue where the send test form was displayed when no API key was set
465
  * Fixed an issue where the subscription test form was not displayed for the default contact list
wpsendgrid.php CHANGED
@@ -3,7 +3,7 @@
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.11.3
7
  Author: SendGrid
8
  Author URI: http://sendgrid.com
9
  Text Domain: sendgrid-email-delivery-simplified
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.11.4
7
  Author: SendGrid
8
  Author URI: http://sendgrid.com
9
  Text Domain: sendgrid-email-delivery-simplified