Outbox Pattern
The outbox pattern is a reliability technique where, instead of calling an external service (like an email API) directly within a database transaction, you write a record to an "outbox" table in the same transaction. A separate worker then processes the outbox and makes the external call. This guarantees that if the transaction commits, the external call will eventually happen, even if the service crashes between the two steps.
b
In BroadcastMail
BroadcastMail uses the outbox pattern for campaign fan-out. When you confirm a campaign, an outbox entry is written in the same transaction. The worker picks it up and fans out to Resend. A crash between confirm and send won't silently drop emails.
RelatedFan-out