diff options
-rw-r--r-- | Postman/Postman-Mail/PostmanSendGridMailEngine.php | 34 | ||||
-rw-r--r-- | postman-smtp.php | 4 | ||||
-rw-r--r-- | readme.txt | 7 |
3 files changed, 12 insertions, 33 deletions
diff --git a/Postman/Postman-Mail/PostmanSendGridMailEngine.php b/Postman/Postman-Mail/PostmanSendGridMailEngine.php index cf652a8..b6082f9 100644 --- a/Postman/Postman-Mail/PostmanSendGridMailEngine.php +++ b/Postman/Postman-Mail/PostmanSendGridMailEngine.php @@ -188,12 +188,12 @@ if ( ! class_exists( 'PostmanSendGridMailEngine' ) ) { $response_body = json_decode( $response->body() ); - $error_code = $response->statusCode(); - $email_not_sent = $error_code != 202; + $response_code = $response->statusCode(); + $email_sent = ( $response_code >= 200 and $response_code < 300 ); - if ( isset( $response_body->errors[0]->message ) || $email_not_sent ) { + if ( isset( $response_body->errors[0]->message ) || ! $email_sent ) { - $e = $email_not_sent ? $this->errorCodesMap($error_code) : $response_body->errors[0]->message; + $e = ! $email_sent ? $this->errorCodesMap($response_code) : $response_body->errors[0]->message; $this->transcript = $e; $this->transcript .= PostmanModuleTransport::RAW_MESSAGE_FOLLOWS; $this->transcript .= print_r( $mail, true ); @@ -213,31 +213,7 @@ if ( ! class_exists( 'PostmanSendGridMailEngine' ) ) { throw $e; } } - - private function get_response_error($body) { - - $error_text = array(); - - if ( ! empty( $body['errors'] ) ) { - foreach ( $body['errors'] as $error ) { - if ( property_exists( $error, 'message' ) ) { - // Prepare additional information from SendGrid API. - $extra = ''; - if ( property_exists( $error, 'field' ) && ! empty( $error->field ) ) { - $extra .= $error->field . '; '; - } - if ( property_exists( $error, 'help' ) && ! empty( $error->help ) ) { - $extra .= $error->help; - } - - // Assign both the main message and perhaps extra information, if exists. - $error_text[] = $error->message . ( ! empty( $extra ) ? ' - ' . $extra : '' ); - } - } - } - - return implode( '<br>', array_map( 'esc_textarea', $error_text ) ); - } + private function errorCodesMap($error_code) { switch ($error_code) { diff --git a/postman-smtp.php b/postman-smtp.php index d27942f..8537790 100644 --- a/postman-smtp.php +++ b/postman-smtp.php @@ -4,7 +4,7 @@ * Plugin Name: Post SMTP * Plugin URI: https://wordpress.org/plugins/post-smtp/ * Description: Email not reliable? Post SMTP is the first and only WordPress SMTP plugin to implement OAuth 2.0 for Gmail, Hotmail and Yahoo Mail. Setup is a breeze with the Configuration Wizard and integrated Port Tester. Enjoy worry-free delivery even if your password changes! - * Version: 1.8.8 + * Version: 1.8.9 * Author: Jason Hendriks, Yehuda Hassine * Text Domain: post-smtp * Author URI: https://postmansmtp.com @@ -123,5 +123,5 @@ function post_start( $startingMemory ) { */ function post_setupPostman() { require_once 'Postman/Postman.php'; - $kevinCostner = new Postman( __FILE__, '1.8.8' ); + $kevinCostner = new Postman( __FILE__, '1.8.9' ); } @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=yehuda@m Tags: postman smtp, postman, smtp, email, mail, mailer, email log, oauth2, gmail, google apps, hotmail, yahoo, mandrill api, sendgrid api, elastic email, office365, mailgun Requires at least: 3.9 Tested up to: 4.9.5 -Stable tag: 1.8.8 +Stable tag: 1.8.9 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -12,7 +12,7 @@ Send, log and troubleshoot your Outgoing Email easily. Supports everything: SMTP == Description == -= Version 1.8.8 released = += Version 1.8.9 released = Lockfile, Contact form 7 and raise the PHP version. [Read the detailes here](https://postmansmtp.com/post-smtp-v1-8-6-lockfile-and-raise-the-php-version/) = WordPress Mail SMTP Plugin = @@ -296,6 +296,9 @@ To avoid being flagged as spam, you need to prove your email isn't forged. On a == Changelog == += 1.8.9 - 2018-04-24 +* Sendgrid bug + = 1.8.8 - 2018-04-24 * file added to svn - contactform7 |