Move Mailer error tests to unit [MAILPOET-2009]

This commit is contained in:
wxa
2019-04-25 11:10:29 +03:00
committed by M. Shull
parent f2e0dc7d2f
commit 994fae79d2
14 changed files with 59 additions and 24 deletions

View File

@ -4,6 +4,7 @@ namespace MailPoet\Mailer\Methods\ErrorMappers;
use MailPoet\Mailer\MailerError;
use MailPoet\Mailer\Mailer;
use MailPoet\Mailer\SubscriberError;
use MailPoet\WP\Functions as WPFunctions;
class SendGridMapper {
use ConnectionErrorMapperTrait;
@ -11,7 +12,7 @@ class SendGridMapper {
function getErrorFromResponse($response, $subscriber) {
$response = (!empty($response['errors'][0])) ?
$response['errors'][0] :
sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_SENDGRID);
sprintf(WPFunctions::get()->__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_SENDGRID);
$level = MailerError::LEVEL_HARD;
if (strpos($response, 'Invalid email address') === 0) {