Fix incompatibilities with new version of Swiftmailer
[MAILPOET-2589]
This commit is contained in:
committed by
Jack Kitterhing
parent
aeac8c664d
commit
43873306cd
@@ -109,7 +109,7 @@ class AmazonSES {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function createMessage($newsletter, $subscriber, $extraParams = []) {
|
public function createMessage($newsletter, $subscriber, $extraParams = []) {
|
||||||
$message = Swift_Message::newInstance()
|
$message = (new Swift_Message())
|
||||||
->setTo($this->processSubscriber($subscriber))
|
->setTo($this->processSubscriber($subscriber))
|
||||||
->setFrom([
|
->setFrom([
|
||||||
$this->sender['from_email'] => $this->sender['from_name'],
|
$this->sender['from_email'] => $this->sender['from_name'],
|
||||||
|
@@ -78,8 +78,7 @@ class SMTP {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function buildMailer() {
|
public function buildMailer() {
|
||||||
$transport = Swift_SmtpTransport::newInstance(
|
$transport = new Swift_SmtpTransport($this->host, $this->port, $this->encryption);
|
||||||
$this->host, $this->port, $this->encryption);
|
|
||||||
$connectionTimeout = $this->wp->applyFilters('mailpoet_mailer_smtp_connection_timeout', self::SMTP_CONNECTION_TIMEOUT);
|
$connectionTimeout = $this->wp->applyFilters('mailpoet_mailer_smtp_connection_timeout', self::SMTP_CONNECTION_TIMEOUT);
|
||||||
$transport->setTimeout($connectionTimeout);
|
$transport->setTimeout($connectionTimeout);
|
||||||
if ($this->authentication) {
|
if ($this->authentication) {
|
||||||
@@ -88,11 +87,11 @@ class SMTP {
|
|||||||
->setPassword($this->password);
|
->setPassword($this->password);
|
||||||
}
|
}
|
||||||
$transport = $this->wp->applyFilters('mailpoet_mailer_smtp_transport_agent', $transport);
|
$transport = $this->wp->applyFilters('mailpoet_mailer_smtp_transport_agent', $transport);
|
||||||
return Swift_Mailer::newInstance($transport);
|
return new Swift_Mailer($transport);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createMessage($newsletter, $subscriber, $extraParams = []) {
|
public function createMessage($newsletter, $subscriber, $extraParams = []) {
|
||||||
$message = Swift_Message::newInstance()
|
$message = (new Swift_Message())
|
||||||
->setTo($this->processSubscriber($subscriber))
|
->setTo($this->processSubscriber($subscriber))
|
||||||
->setFrom(
|
->setFrom(
|
||||||
[
|
[
|
||||||
|
Reference in New Issue
Block a user