Move mailer configuration to init method

[MAILPOET-2146]
This commit is contained in:
Pavel Dohnal
2019-07-24 10:40:00 +02:00
committed by M. Shull
parent d6f263ef3f
commit 8739646a6a
7 changed files with 40 additions and 23 deletions

View File

@ -110,10 +110,9 @@ class ConfirmationEmailMailer {
// send email
try {
if (!$this->mailer) {
$this->mailer = new Mailer(false, $from, $reply_to);
$this->mailer = new Mailer();
}
$this->mailer->getSenderNameAndAddress($from);
$this->mailer->getReplyToNameAndAddress($reply_to);
$this->mailer->init(false, $from, $reply_to);
$result = $this->mailer->send($email, $subscriber);
if ($result['response'] === false) {
$subscriber->setError(__('Something went wrong with your subscription. Please contact the website owner.', 'mailpoet'));