diff --git a/src/Mailer.php b/src/Mailer.php index 3ec6cd9..74149d7 100644 --- a/src/Mailer.php +++ b/src/Mailer.php @@ -81,6 +81,12 @@ class Mailer extends CApplicationComponent */ public $defaultHeaders = []; + /** + * @var \Psr\Log\LoggerInterface|null PSR logger to be applied to the mail transport. + * @see https://github.com/yii1tech/psr-log + */ + public $logger; + /** * @var \Symfony\Component\Mailer\Mailer Symfony mailer instance. */ @@ -182,9 +188,9 @@ public function getTransport(): TransportInterface } if ($this->dsn === 'array://') { - $this->_transport = new ArrayTransport(); + $this->_transport = new ArrayTransport(null, $this->logger); } else { - $this->_transport = Transport::fromDsn($this->dsn); + $this->_transport = Transport::fromDsn($this->dsn, null, null, $this->logger); } return $this->_transport;