A practical guide to reliably tracking transactional email delivery states (accepted, processing, deferred, delivered, bounced, rejected, complained) by maintaining local delivery records correlated with provider events. Covers creating delivery rows before sending, normalizing message IDs, validating incoming webhook events, handling race conditions between event arrival and message ID storage, deduplicating events using unique constraints and outbox patterns, ignoring out-of-order events with timestamp guards, and building an admin view that surfaces only actionable failures per subscriber.
Table of contents
Create the delivery record firstNormalize the provider message IDValidate incoming eventsHandle the correlation raceDeduplicate event side effectsIgnore older eventsSeparate terminal and non-terminal statesShow failures that require action67 Impressions