Part 5: After the Dispatch - Handling Delivery Events
Description and use
Implemented a workflow for capturing, storing, and displaying delivery events from multiple communication providers.
Problem
Capturing and storing delivery events from multiple communication providers to provide visibility to support, engineering, and customers.
Outcome
Implemented end-to-end delivery event handling, enabling persistent tracking of message status across providers and a buyer-facing messages interface.
Workflow
- 1. Resolve buyer’s verified addresses and select first available channel.
- 2. Dispatch message via Transmitly; provider returns message id and OnDispatched report is raised.
- 3. Provider sends status change webhook; Transmitly converts to OnStatusChanged report.
- 4. DeliveryReportHandler queues reports.
- 5. Background service processes queue, records each report using DeliveryReportRecorder.
- 6. Delivery history stored in communicationsdb with CommunicationRecord and DeliveryEvent tables.
- 7. Buyer can view messages and statuses on new Messages page.
Evidence
Both kinds reach the same place. Next to the logging handler from Part 2, Communications registers a delivery report handler for recording:
A background service reads the queue and records one report at a time:
- Record date: 2026-10-23T00:11:46.985Z