From 91c88bc93f271f4ec0ba4a728a5eb3a90f19cdfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=CC=81n=20Mikla=CC=81s=CC=8C?= Date: Mon, 18 Feb 2019 14:55:28 +0100 Subject: [PATCH] Better error code name when not able to send mails [MAILPOET-1787] --- lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php | 2 +- lib/Services/Bridge/API.php | 2 +- .../Mailer/Methods/ErrorMappers/MailPoetMapperTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php b/lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php index 0802014d1f..ecb2fc372d 100644 --- a/lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php +++ b/lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php @@ -50,7 +50,7 @@ class MailPoetMapper { $message = __('Email service is temporarily not available, please try again in a few minutes.', 'mailpoet'); $retry_interval = self::TEMPORARY_UNAVAILABLE_RETRY_INTERVAL; break; - case API::RESPONSE_CODE_BANNED_ACCOUNT: + case API::RESPONSE_CODE_CAN_NOT_SEND: $message = Helpers::replaceLinkTags( __('You currently are not permitted to send any emails with MailPoet Sending Service, which may have happened due to poor deliverability. Please [link]contact our support team[/link] to resolve the issue.', 'mailpoet'), 'https://www.mailpoet.com/support/', diff --git a/lib/Services/Bridge/API.php b/lib/Services/Bridge/API.php index aced5048b6..0eebd436cd 100644 --- a/lib/Services/Bridge/API.php +++ b/lib/Services/Bridge/API.php @@ -19,7 +19,7 @@ class API { const RESPONSE_CODE_NOT_ARRAY = 422; const RESPONSE_CODE_PAYLOAD_TOO_BIG = 413; const RESPONSE_CODE_PAYLOAD_ERROR = 400; - const RESPONSE_CODE_BANNED_ACCOUNT = 403; + const RESPONSE_CODE_CAN_NOT_SEND = 403; private $api_key; private $wp; diff --git a/tests/integration/Mailer/Methods/ErrorMappers/MailPoetMapperTest.php b/tests/integration/Mailer/Methods/ErrorMappers/MailPoetMapperTest.php index f6a1a285a7..aa036637dd 100644 --- a/tests/integration/Mailer/Methods/ErrorMappers/MailPoetMapperTest.php +++ b/tests/integration/Mailer/Methods/ErrorMappers/MailPoetMapperTest.php @@ -43,7 +43,7 @@ class MailPoetMapperTest extends \MailPoetTest { function testGetErrorBannedAccount() { $api_result = [ - 'code' => API::RESPONSE_CODE_BANNED_ACCOUNT, + 'code' => API::RESPONSE_CODE_CAN_NOT_SEND, 'status' => API::SENDING_STATUS_SEND_ERROR, 'message' => 'this is a spam', ];