Skip to content

Commit

Permalink
Fix compatibility for Contao 4.5 and its Swiftmailer 6 (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
qzminski committed Jan 23, 2018
1 parent b7320e2 commit 8061d3f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion library/NotificationCenter/Gateway/Email.php
Expand Up @@ -70,7 +70,11 @@ public function send(Message $objMessage, array $arrTokens, $strLanguage = '')

// Override SMTP settings if desired
if (version_compare(VERSION, '4.4', '>=') && $this->objModel->email_overrideSmtp) {
$transport = \Swift_SmtpTransport::newInstance($this->objModel->email_smtpHost, $this->objModel->email_smtpPort);
if (version_compare(VERSION, '4.5', '>=')) {
$transport = new \Swift_SmtpTransport($this->objModel->email_smtpHost, $this->objModel->email_smtpPort);
} else {
$transport = \Swift_SmtpTransport::newInstance($this->objModel->email_smtpHost, $this->objModel->email_smtpPort);
}

// Encryption
if ($this->objModel->email_smtpEnc === 'ssl' || $this->objModel->email_smtpEnc === 'tls') {
Expand Down

0 comments on commit 8061d3f

Please sign in to comment.