Remove unnecessary test_email extra parameter for mailer->send
It was used only to prevent appending unprocessed subscribers into error message. Since the message is now composed by on demand by MailerError the parameter is not needed any more. [MAILPOET-1154]
This commit is contained in:
@@ -8,7 +8,7 @@ use MailPoet\Mailer\SubscriberError;
|
||||
class SendGridMapper {
|
||||
use ConnectionErrorMapperTrait;
|
||||
|
||||
function getErrorFromResponse($response, $subscriber, $extra_params) {
|
||||
function getErrorFromResponse($response, $subscriber) {
|
||||
$response = (!empty($response['errors'][0])) ?
|
||||
$response['errors'][0] :
|
||||
sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_SENDGRID);
|
||||
@@ -17,11 +17,7 @@ class SendGridMapper {
|
||||
if(strpos($response, 'Invalid email address') === 0) {
|
||||
$level = MailerError::LEVEL_SOFT;
|
||||
}
|
||||
|
||||
$subscriber_errors = [];
|
||||
if(empty($extra_params['test_email'])) {
|
||||
$subscriber_errors[] = new SubscriberError($subscriber, null);
|
||||
}
|
||||
$subscriber_errors = [new SubscriberError($subscriber, null)];
|
||||
return new MailerError(MailerError::OPERATION_SEND, $level, $response, null, $subscriber_errors);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user