From 6ae641ee8f6a8c2a250b2caa382fb55257ed9ba3 Mon Sep 17 00:00:00 2001 From: Lamm Date: Mon, 16 Mar 2026 09:34:55 +0100 Subject: [PATCH] Fix DI of LoggingTransportFactory --- Classes/Logging/MailerExtender.php | 8 ++++++-- Configuration/Services.yaml | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) 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