Fix duplicate EmailLog rows for a single sent email

Mailer dispatches MessageEvent twice when routed through Messenger:
once when queuing (queued=true) and once on the actual send from the
worker (queued=false). EmailLoggerListener logged on both, creating
two rows per email actually sent. Skip the queued dispatch.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Frank
2026-07-04 14:44:03 +02:00
co-authored by Claude Sonnet 5
parent 0e12e7fa8f
commit 4a5d83ef53
@@ -22,6 +22,10 @@ class EmailLoggerListener
public function onMessage(MessageEvent $event): void
{
if ($event->isQueued()) {
return;
}
$message = $event->getMessage();
if (!$message instanceof TemplatedEmail) {
return;