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:
@ -12,7 +12,7 @@ class SMTPMapper {
|
||||
* @see https://swiftmailer.symfony.com/docs/sending.html
|
||||
* @return MailerError
|
||||
*/
|
||||
function getErrorFromException(\Exception $e, $subscriber, $extra_params = []) {
|
||||
function getErrorFromException(\Exception $e, $subscriber) {
|
||||
// remove redundant information appended by Swift logger to exception messages
|
||||
$message = explode(PHP_EOL, $e->getMessage());
|
||||
|
||||
@ -20,16 +20,11 @@ class SMTPMapper {
|
||||
if($e instanceof \Swift_RfcComplianceException) {
|
||||
$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, $message[0], null, $subscriber_errors);
|
||||
}
|
||||
|
||||
function getErrorFromLog($log, $subscriber, $extra_params = []) {
|
||||
function getErrorFromLog($log, $subscriber) {
|
||||
// extract error message from log
|
||||
preg_match('/!! (.*?)>>/ism', $log, $message);
|
||||
if(!empty($message[1])) {
|
||||
@ -39,11 +34,7 @@ class SMTPMapper {
|
||||
} else {
|
||||
$message = sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_SMTP);
|
||||
}
|
||||
|
||||
$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, MailerError::LEVEL_HARD, $message, null, $subscriber_errors);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user