diff --git a/Classes/Logging/MailerExtender.php b/Classes/Logging/MailerExtender.php index b620858..a66222d 100644 --- a/Classes/Logging/MailerExtender.php +++ b/Classes/Logging/MailerExtender.php @@ -8,18 +8,22 @@ use Psr\EventDispatcher\EventDispatcherInterface; use Symfony\Component\Mailer\Transport\TransportInterface; use TYPO3\CMS\Core\Mail\Mailer; +use TYPO3\CMS\Core\Utility\GeneralUtility; /** * Extends the core Mailer to grab and log all outgoing mails. */ class MailerExtender extends Mailer { + protected LoggingTransportFactory $loggingTransportFactory; + public function __construct( - protected LoggingTransportFactory $loggingTransportFactory, ?TransportInterface $transport = null, - ?EventDispatcherInterface $eventDispatcher = null, + ?EventDispatcherInterface $eventDispatcher = null ) { parent::__construct($transport, $eventDispatcher); + + $this->loggingTransportFactory = GeneralUtility::makeInstance(LoggingTransportFactory::class); $this->transport = $this->loggingTransportFactory->create($this->transport); } diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index 6df6151..f5189ca 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -16,7 +16,6 @@ services: Pluswerk\MailLogger\Logging\MailerExtender: arguments: - $loggingTransportFactory: '@Pluswerk\MailLogger\Logging\LoggingTransportFactory' $transport: null $eventDispatcher: null