Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

Notification Delivery

Finance emits order-notification commands over Kafka; Notification API applies Redis idempotency, renders MJML email templates, and submits MIME messages over SMTP with bounded retries and dead-lettering.

Platform Capability

Trigger & Business Outcome

This flow is triggered when Order OrchestrationServicev1.0.0Order OrchestrationMessage-driven Finance workflow service that coordinates post-checkout basket cleanup and order notifications using Dura...PublishesPlaceOrderCommand, DeleteBasketCompleteCommand +3SubscribesUserCheckedOutIntegrationEvent, OrderStatusChangedToCompleteIntegrationEvent +3APIsAsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs publishes Place orderCommandv1.0.0Place orderShared Finance order-placement command consumed by Notification to render and submit a new-order email. Ownerplatform-engineering-teamSchemaDiagramOpen docs, Send order completed notificationCommandv1.0.0Send order completed notificationShared Finance completion command consumed by Notification to render and submit a completed-order email. Ownerplatform-engineering-teamSchemaDiagramOpen docs, or Send order cancelled notificationCommandv1.0.0Send order cancelled notificationShared Finance cancellation command consumed by Notification to render and submit a canceled-order email. Ownerplatform-engineering-teamSchemaDiagramOpen docs over Kafka. Success is confirmed when Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs passes its Redis idempotency check, renders the MJML order template, and hands the MIME message off to SendGrid APIServicev1.0.0SendGrid APIExternal SMTP email delivery provider used by BookWorm to submit rendered order notification emails over authenticated S...Ownerplatform-engineering-teamDiagramOpen docs over SMTP (or Mailpit in local development) without maintaining any relational email outbox.

Interactive Flow Visualization

Step-by-Step Walkthrough

Stateless Email Rendering and Resilient SMTP Handoff

  1. Consume order notification command

    Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs consumes Place orderCommandv1.0.0Place orderShared Finance order-placement command consumed by Notification to render and submit a new-order email. Ownerplatform-engineering-teamSchemaDiagramOpen docs, Send order completed notificationCommandv1.0.0Send order completed notificationShared Finance completion command consumed by Notification to render and submit a completed-order email. Ownerplatform-engineering-teamSchemaDiagramOpen docs, or Send order cancelled notificationCommandv1.0.0Send order cancelled notificationShared Finance cancellation command consumed by Notification to render and submit a canceled-order email. Ownerplatform-engineering-teamSchemaDiagramOpen docs from Kafka partitioned by Order ID.

  2. Apply Redis idempotency and validate recipient

    A Redis-backed idempotency guard (24-hour TTL keyed by message ID) prevents duplicate sends on Kafka redeliveries or worker retries. If the recipient email address is blank, processing ends cleanly without calling SMTP.

  3. Render MJML template and submit over SMTP

    Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs renders the order email template into a MIME message and submits it to SendGrid APIServicev1.0.0SendGrid APIExternal SMTP email delivery provider used by BookWorm to submit rendered order notification emails over authenticated S...Ownerplatform-engineering-teamDiagramOpen docs (or Mailpit locally) through a resilient SMTP pipeline. No delivery-result callback is published back to OrderingDomainv1.0.0OrderingCreates durable Orders from a buyer's current basket, locks purchase-time pricing, and owns order lifecycle transitions ...Ownercommerce-fulfillment-teamDiagramOpen docs.

Failure, Retry & Compensation Behavior

Failure PointSystem BehaviorCompensation / Recovery
Blank recipient emailHandler returns immediately without calling SMTPNo error or retry; order state is unaffected
Transient SMTP throttling or timeoutMailKit resilience and worker cooldown retries executeIf retries exhaust, the command routes to <code>bookworm.{env}.notification.dead-letter-queue</code>
Finance timeout reissueorder-orchestration emits a new PlaceOrderCommand with a new message IDBypasses per-message-ID deduplication and may send a duplicate placement email
Note

Stateless worker boundary: Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs owns no PostgreSQL database and no email outbox. SMTP acceptance confirms handoff to the mail provider, not final inbox delivery.

Participating Resources