From b2e556fd90bb7d9606b846a2ac88c8a53b7e5fc5 Mon Sep 17 00:00:00 2001 From: Sam Najian Date: Wed, 15 Jun 2022 16:56:32 +0200 Subject: [PATCH] Inject WPFunctions to AmazonSES [MAILPOET-4394] --- mailpoet/lib/Mailer/MailerFactory.php | 3 ++- mailpoet/lib/Mailer/Methods/AmazonSES.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mailpoet/lib/Mailer/MailerFactory.php b/mailpoet/lib/Mailer/MailerFactory.php index 31678f73df..ba134fab3a 100644 --- a/mailpoet/lib/Mailer/MailerFactory.php +++ b/mailpoet/lib/Mailer/MailerFactory.php @@ -57,7 +57,8 @@ class MailerFactory { $sender, $replyTo, $returnPath, - new AmazonSESMapper() + new AmazonSESMapper(), + $this->wp ); break; case Mailer::METHOD_MAILPOET: diff --git a/mailpoet/lib/Mailer/Methods/AmazonSES.php b/mailpoet/lib/Mailer/Methods/AmazonSES.php index d9bf9fa34b..194ca59b1d 100644 --- a/mailpoet/lib/Mailer/Methods/AmazonSES.php +++ b/mailpoet/lib/Mailer/Methods/AmazonSES.php @@ -73,7 +73,8 @@ class AmazonSES extends PHPMailerMethod { $sender, $replyTo, $returnPath, - AmazonSESMapper $errorMapper + AmazonSESMapper $errorMapper, + WPFunctions $wp ) { $this->awsAccessKey = $accessKey; $this->awsSecretKey = $secretKey; @@ -93,7 +94,7 @@ class AmazonSES extends PHPMailerMethod { $this->date = gmdate('Ymd\THis\Z'); $this->dateWithoutTime = gmdate('Ymd'); $this->errorMapper = $errorMapper; - $this->wp = new WPFunctions(); + $this->wp = $wp; $this->blacklist = new BlacklistCheck(); $this->mailer = $this->buildMailer(); }