Transmitly Part 5: Recording .NET message delivery events
Part 5 of the Transmitly eShop series shows how delivery updates that arrive after dispatch are captured and stored. Provider webhooks, such as Twilio status callbacks, are normalized into one DeliveryReport model and saved in a Communications database. It is a practical reference for building message history and delivery tracking in ASP.NET Core.
Key points
- Dispatch reports (OnDispatched) and later webhook updates (OnStatusChanged) share one DeliveryReport type.
- Recording happens in a background service fed by a channel queue, so dispatch and webhook requests never wait on the database.
- Records are matched by channel and provider message id; later reports only fill empty fields.
- The webhook endpoint is anonymous, so production code must validate each provider's request signature.
- Twilio ErrorCode values such as 30003, 30005 and 30007 call for different responses and are worth keeping as provider details.
Dispatched only means a provider accepted a message, not that the recipient received it. Part 5 of the Transmitly eShop series captures the later delivery updates, such as Twilio status callbacks, and stores them in a database owned by Communications. Each buyer now gets one message on the first verified channel they can be reached on: email, SMS or push.
Every provider update is turned into one DeliveryReport type, carrying the event name, channel, provider id and a provider-neutral status. A background service drains a queue and writes communications and delivery events to communicationsdb, while an ASP.NET Core model binder routes webhook requests to the matching provider adaptor. Provider-specific details, such as Twilio error codes, are optional and kept for support work.
Real-world use
- An e-commerce backend that sends order confirmations on one verified channel per buyer.
- A support dashboard that needs to show whether a customer actually received a message.
- An operations team comparing failure rates across SMS providers over time.
Why it matters
Treating a successful dispatch as proof of delivery is misleading; storing later webhook updates gives support and debugging real data. The provider-neutral model lets you write tracking code once and reuse it across channels.