Better error code name when not able to send mails

[MAILPOET-1787]
This commit is contained in:
Ján Mikláš
2019-02-18 14:55:28 +01:00
committed by M. Shull
parent de4a95cf92
commit 91c88bc93f
3 changed files with 3 additions and 3 deletions

View File

@ -50,7 +50,7 @@ class MailPoetMapper {
$message = __('Email service is temporarily not available, please try again in a few minutes.', 'mailpoet'); $message = __('Email service is temporarily not available, please try again in a few minutes.', 'mailpoet');
$retry_interval = self::TEMPORARY_UNAVAILABLE_RETRY_INTERVAL; $retry_interval = self::TEMPORARY_UNAVAILABLE_RETRY_INTERVAL;
break; break;
case API::RESPONSE_CODE_BANNED_ACCOUNT: case API::RESPONSE_CODE_CAN_NOT_SEND:
$message = Helpers::replaceLinkTags( $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'), __('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/', 'https://www.mailpoet.com/support/',

View File

@ -19,7 +19,7 @@ class API {
const RESPONSE_CODE_NOT_ARRAY = 422; const RESPONSE_CODE_NOT_ARRAY = 422;
const RESPONSE_CODE_PAYLOAD_TOO_BIG = 413; const RESPONSE_CODE_PAYLOAD_TOO_BIG = 413;
const RESPONSE_CODE_PAYLOAD_ERROR = 400; const RESPONSE_CODE_PAYLOAD_ERROR = 400;
const RESPONSE_CODE_BANNED_ACCOUNT = 403; const RESPONSE_CODE_CAN_NOT_SEND = 403;
private $api_key; private $api_key;
private $wp; private $wp;

View File

@ -43,7 +43,7 @@ class MailPoetMapperTest extends \MailPoetTest {
function testGetErrorBannedAccount() { function testGetErrorBannedAccount() {
$api_result = [ $api_result = [
'code' => API::RESPONSE_CODE_BANNED_ACCOUNT, 'code' => API::RESPONSE_CODE_CAN_NOT_SEND,
'status' => API::SENDING_STATUS_SEND_ERROR, 'status' => API::SENDING_STATUS_SEND_ERROR,
'message' => 'this is a spam', 'message' => 'this is a spam',
]; ];