feat: send mailings over MailJet smtp in dedicated worker process

This commit is contained in:
Björn Fromme committed 2026-08-12 15:47:04 +02:00
1 parent a5c98025d0
commit e0a9562fc6
14 files changed
+480 -44

No files matched your search

@@ -0,0 +1,30 @@
<?php
namespace App\MessageHandler;
use App\Message\SendTeamerMailing;
use App\Service\Teamer\TeamerMailingService;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
/**
* Fans a confirmed mailing out into one queued mail per recipient.
*
* The request that confirmed the mailing only enqueues this single message, so it answers
* in constant time no matter how many teamers the filter matched, and a mailing is either
* enqueued whole or not at all. Every mail this produces is queued separately, so a
* recipient whose address bounces is retried on its own instead of dragging the rest of
* the mailing through a retry with it.
*/
#[AsMessageHandler]
class SendTeamerMailingHandler
{
public function __construct(
private readonly TeamerMailingService $mailingService,
) {
}
public function __invoke(SendTeamerMailing $mailing): void
{
$this->mailingService->sendMailing($mailing);
}
}