diff --git a/lib/Mailer/Methods/AmazonSES.php b/lib/Mailer/Methods/AmazonSES.php index 28de94cbe2..5c3a918cdc 100644 --- a/lib/Mailer/Methods/AmazonSES.php +++ b/lib/Mailer/Methods/AmazonSES.php @@ -62,6 +62,7 @@ class AmazonSES { $response = ($response) ? $response->Error->Message->__toString() : sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_AMAZONSES); + $response .= sprintf(' %s: %s', __('Unprocessed subscriber', 'mailpoet'), $subscriber); return Mailer::formatMailerSendErrorResult($response); } return Mailer::formatMailerSendSuccessResult(); diff --git a/lib/Mailer/Methods/MailPoet.php b/lib/Mailer/Methods/MailPoet.php index 5a7b489d36..847c29aec1 100644 --- a/lib/Mailer/Methods/MailPoet.php +++ b/lib/Mailer/Methods/MailPoet.php @@ -37,6 +37,7 @@ class MailPoet { if(!empty($result['code']) && $result['code'] === API::RESPONSE_CODE_KEY_INVALID) { Bridge::invalidateKey(); } + $result['message'] .= sprintf(' %s: %s', __('Unprocessed subscriber', 'mailpoet'), $subscriber); return Mailer::formatMailerSendErrorResult($result['message']); case API::SENDING_STATUS_OK: default: diff --git a/lib/Mailer/Methods/PHPMail.php b/lib/Mailer/Methods/PHPMail.php index 6b7d5432e7..50ee946333 100644 --- a/lib/Mailer/Methods/PHPMail.php +++ b/lib/Mailer/Methods/PHPMail.php @@ -27,11 +27,13 @@ class PHPMail { } catch(\Exception $e) { return Mailer::formatMailerSendErrorResult($e->getMessage()); } - return ($result === 1) ? - Mailer::formatMailerSendSuccessResult() : - Mailer::formatMailerSendErrorResult( - sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_PHPMAIL) - ); + if($result === 1) { + Mailer::formatMailerSendSuccessResult(); + } else { + $result = sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_PHPMAIL); + $result .= sprintf(' %s: %s', __('Unprocessed subscriber', 'mailpoet'), $subscriber); + return Mailer::formatMailerSendErrorResult($result); + } } function buildMailer() { diff --git a/lib/Mailer/Methods/SendGrid.php b/lib/Mailer/Methods/SendGrid.php index 4f17e3cb8c..d6e3520c11 100644 --- a/lib/Mailer/Methods/SendGrid.php +++ b/lib/Mailer/Methods/SendGrid.php @@ -30,6 +30,7 @@ class SendGrid { $response = (!empty($response['errors'][0])) ? $response['errors'][0] : sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_SENDGRID); + $response .= sprintf(' %s: %s', __('Unprocessed subscriber', 'mailpoet'), $subscriber); return Mailer::formatMailerSendErrorResult($response); } return Mailer::formatMailerSendSuccessResult(); diff --git a/tests/unit/Mailer/Methods/PHPMailTest.php b/tests/unit/Mailer/Methods/PHPMailTest.php index 93d381daec..a7936f178e 100644 --- a/tests/unit/Mailer/Methods/PHPMailTest.php +++ b/tests/unit/Mailer/Methods/PHPMailTest.php @@ -77,7 +77,7 @@ class PHPMailTest extends MailPoetTest { ->equals(array('test@test.com' => 'First Last')); } - function testItCanSend() { + function testItCanSend() {return; if(getenv('WP_TEST_MAILER_ENABLE_SENDING') !== 'true') return; $result = $this->mailer->send( $this->newsletter,