Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Classes/Logging/MailerExtender.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
1 change: 0 additions & 1 deletion Configuration/Services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ services:

Pluswerk\MailLogger\Logging\MailerExtender:
arguments:
$loggingTransportFactory: '@Pluswerk\MailLogger\Logging\LoggingTransportFactory'
$transport: null
$eventDispatcher: null

Expand Down
Loading