Replace Swift_message with PHPMailer

[MAILPOET-4142]
This commit is contained in:
Jan Lysý
2022-05-11 09:37:00 +02:00
committed by Veljko V
parent d7582ede37
commit 0186ddee35
3 changed files with 64 additions and 83 deletions

View File

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace MailPoet\Mailer\Methods\ErrorMappers;
@ -6,7 +6,6 @@ use MailPoet\Mailer\Mailer;
use MailPoet\Mailer\MailerError;
use MailPoet\Mailer\SubscriberError;
use MailPoet\WP\Functions as WPFunctions;
use MailPoetVendor\Swift_RfcComplianceException;
class AmazonSESMapper {
use BlacklistErrorMapperTrait;
@ -16,7 +15,7 @@ class AmazonSESMapper {
public function getErrorFromException(\Exception $e, $subscriber) {
$level = MailerError::LEVEL_HARD;
if ($e instanceof Swift_RfcComplianceException) {
if (strpos($e->getMessage(), 'Invalid address') !== false && strpos($e->getMessage(), '(to):') !== false) {
$level = MailerError::LEVEL_SOFT;
}
$subscriberErrors = [new SubscriberError($subscriber, null)];