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

Read the architecture guide →

ADR-006: Delegate email delivery through shared Finance commands

Finance supplies order and recipient data through commands while Notification owns rendering, email persistence, and SMTP submission.

November 3, 2026AcceptedIntegration

1. Context & Problem

Finance receives the order details and customer contact information needed to trigger order-related emails, yet it should not own email templates, mail-server credentials, delivery logs, or email retry logic. At the same time, the initial placement message published by Finance is also consumed by Basket for cleanup, meaning a retry for one participant can repeat work for the other.

This retrospective ADR documents the existing delegation boundary with Notification SystemSystemv1.0.0Notification SystemInternal platform system that consumes order commands, renders email templates, and submits messages over SMTP. Ownerplatform-engineering-teamDiagramOpen docs and its duplicate-processing trade-offs; it does not introduce a guaranteed or exactly-once email delivery promise.

2. Business Value

  • Focused service responsibilities: Finance stays dedicated to checkout coordination while Notification SystemSystemv1.0.0Notification SystemInternal platform system that consumes order commands, renders email templates, and submits messages over SMTP. Ownerplatform-engineering-teamDiagramOpen docs centralizes email branding, rendering, delivery tracking, and mail-provider retries.
  • No mail-provider bottleneck: Checkout coordination never stalls waiting on external email servers or delivery confirmations.
  • Tighter security and isolation: Finance does not hold mail-server credentials, manage templates, or access Notification’s database.

3. How It Works

  1. Shared placement handoff: When checkout coordination starts—and whenever a scheduled retry reissues it—Finance publishes a placement request immediately without waiting for basket cleanup first. Basket uses that request to clean up the submitted basket, while Notification independently uses it to prepare a new-order email.
  2. Recipient check on final status emails: When an Order reaches a completed or cancelled state, or when Finance exhausts its placement retries, Finance checks that both customer name and email are non-blank before sending a completion or cancellation email request. The initial placement request skips this check because Basket needs it regardless of contact fields.
  3. Delegated email lifecycle: Notification SystemSystemv1.0.0Notification SystemInternal platform system that consumes order commands, renders email templates, and submits messages over SMTP. Ownerplatform-engineering-teamDiagramOpen docs takes full ownership of rendering the email, storing durable delivery records, submitting to the mail provider, and running maintenance retries.
  4. No delivery acknowledgment back to Finance: Finance treats email requests as fire-and-forget handoffs. Workflow completion depends strictly on Basket and Order lifecycle outcomes, not on email acceptance or inbox delivery.

4. Trade-offs & Lessons Learned

Alternatives Considered

  • Rendering and sending email directly from Finance: Would couple checkout coordination to email templates, mail-server credentials, delivery persistence, and email retries.
  • Waiting for email delivery before completing the workflow: Email delivery is not a business prerequisite for Order completion, and Finance receives no application-level delivery acknowledgment.
  • Publishing separate placement commands for Basket and Notification: Would decouple basket cleanup retries from placement emails, but the implemented design uses one shared contract; splitting it later would require coordinated contract and consumer updates.

Operational Realities & Caveats

  • Not an exactly-once email mechanism: Reissuing the shared placement request during timeout retries can create duplicate new-order emails as well as repeated basket cleanup.
  • Strict terminal contact guard: While Notification itself skips blank email addresses, Finance requires both name and email to be non-blank before sending completion or cancellation requests—meaning a workflow can finish without triggering a final email.
  • No validation or delivery guarantee: Non-blank recipient details do not guarantee a valid or deliverable mailbox; mail-provider failures remain Notification’s responsibility, and Finance completion cannot be equated with customer delivery.
  • Shared contract review discipline: Any schema or routing change to the shared placement command impacts both Basket and Notification independently and must be reviewed with both consumers.

5. Technical Reference

Command & Guard Matrix

CommandPublished WhenRecipient GuardConsumers & Responsibilities
Place orderCommandv1.0.0Place orderShared Finance order-placement command consumed by Notification to render and submit a new-order email. Ownerplatform-engineering-teamSchemaDiagramOpen docsSaga start and timeout reissuesNone (ungated because Basket also consumes it)Basket performs cleanup; Notification SystemSystemv1.0.0Notification SystemInternal platform system that consumes order commands, renders email templates, and submits messages over SMTP. Ownerplatform-engineering-teamDiagramOpen docs sends new-order email.
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 docsAuthoritative Order completed eventBoth name and email nonblankNotification SystemSystemv1.0.0Notification SystemInternal platform system that consumes order commands, renders email templates, and submits messages over SMTP. Ownerplatform-engineering-teamDiagramOpen docs renders, persists outbox record, and submits SMTP email.
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 docsAuthoritative Order cancelled event or timeout exhaustionBoth name and email nonblankNotification SystemSystemv1.0.0Notification SystemInternal platform system that consumes order commands, renders email templates, and submits messages over SMTP. Ownerplatform-engineering-teamDiagramOpen docs renders, persists outbox record, and submits SMTP email.

Boundary Details

  • Notification ownership: Notification SystemSystemv1.0.0Notification SystemInternal platform system that consumes order commands, renders email templates, and submits messages over SMTP. Ownerplatform-engineering-teamDiagramOpen docs owns template rendering, durable email outbox records, SMTP submission, and maintenance retries.
  • Zero dependency on Notification internals: Finance has no dependency on email templates, SMTP credentials, or Notification’s database, and receives no application-level delivery acknowledgment.
  • Duplicate processing surface: Reissuing Place orderCommandv1.0.0Place orderShared Finance order-placement command consumed by Notification to render and submit a new-order email. Ownerplatform-engineering-teamSchemaDiagramOpen docs repeats both Basket cleanup handling and Notification placement-email handling.