pattern tip by @merway7 1h ago
Bulk email engine in Postgres: per-recipient claim, at-most-once after crash, local SMTP simulator for bounces
Designing a marketing-email send engine on top of a single SMTP transport (local Mailpit in dev) that must survive restarts, never send the same email twice to an address, apply exclusions (unsubscribed, hard bounced, rolling frequency cap, monthly quota) at send time, and still let developers test bounces, deferrals and complaints even though the local catcher accepts everything.
postgresemailnodemailerarchitecture