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

Read the architecture guide →

ADR-005: Treat notification content and credentials as confidential

Notification keeps recipient data and rendered content transient during SMTP delivery and requires runtime secrets and restricted operational access.

November 1, 2026AcceptedSecurity

1. Context & Problem

Customer notification records store personal details—such as recipient names and email addresses—alongside email subjects and rendered order content. In addition, the notification service relies on privileged credentials to connect to its database and external mail provider.

If these customer details or connection secrets are copied into routine operational logs, scheduled maintenance requests, or architecture documentation, far more people and systems gain access to sensitive data than email delivery actually requires.

2. Business Value

  • Customer privacy and trust: Restricts visibility of personal contact information and order messages strictly to delivery processing and authorized support tasks.
  • Stronger security posture: Keeps database and mail-provider credentials out of source repositories, documentation, stored message rows, and everyday logs.
  • Clear data ownership: Prevents temporary email queues from being misused as an order-reporting store or mistaken for official business confirmation.
  • Safer operations: Enables support and operations teams to monitor queue volume, age, and failure trends using non-sensitive counts and identifiers.

3. How It Works

This decision sets clear access, secrecy, and monitoring rules around notification data:

  • Restricted storage: The notification database is treated as confidential. Only the notification service and authorized staff with an active delivery or support need may access recipient details or message content.
  • Authoritative boundaries: Upstream business areas remain the single source of truth for order state. Stored notification records exist solely for delivery and are not a general-purpose order export.
  • Isolated credentials: Passwords and keys for data storage and email sending live exclusively in secure runtime configuration—never in code repositories, documentation, stored messages, or routine logs.
  • Minimal maintenance messages: Scheduled cleanup triggers carry only basic request metadata and never copy recipient details or email bodies.
  • Privacy-friendly diagnostics: Routine monitoring relies on record identifiers, sequence numbers, timestamps, backlog totals, and sanitized error categories rather than personal data.
  • Known implementation gaps: Existing retry and sending-failure logs currently still include recipient addresses (and, for sending failures, email subjects). Those paths are marked for remediation; this decision states the target policy rather than claiming full current compliance.
  • Housekeeping vs. formal retention: Sent records are currently cleared on a recurring hourly schedule without an age threshold, while unsent records have no age-based expiry. Neither behavior represents a formal privacy retention period or delivery audit policy.

4. Trade-offs & Lessons Learned

  • Debugging speed vs. data exposure: Logging complete email bodies and recipient details makes local troubleshooting easier, but spreads confidential data across monitoring tools. Relying on identifiers and sanitized failure categories requires narrowly authorized support access when deeper inspection is needed.
  • Immediate deletion vs. operational visibility: Deleting sent records immediately upon handoff would shorten data exposure, but would eliminate the current inspection window between runs. Any future change must establish an explicit policy balancing privacy, recovery, and audit needs.
  • Layered controls are mandatory: Storing credentials in secure runtime configuration protects connections, but does not by itself restrict who can read stored emails or log files. Database permissions and log sanitization must be managed as separate safeguards.
  • Rejected alternatives:
    • Carrying email content in scheduler messages: Duplicates confidential data and couples scheduling to the delivery model.
    • Logging full message payloads for debugging: Unacceptably increases personal data exposure in routine logs.
    • Immediate post-submission deletion: Removes the bounded inspection window without establishing a proper retention policy.

5. Technical Reference

  • Decision status & scope: Accepted (2026-11-01), applying to notification-system and 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.
  • Confidential data store: The Notification PostgreSQL database holds email outbox rows containing recipient names, addresses, subjects, and rendered order content.
  • Runtime secrets: SMTP authentication and PostgreSQL connection strings must be supplied via runtime secret configuration and excluded from catalog content, source control, outbox rows, and routine logs.
  • Observability & logging policy:
    • Prefer outbox identifiers, sequence numbers, timestamps, aggregate backlog counts, and sanitized error categories.
    • Avoid selecting recipient or body columns in operational queries unless required by an authorized support task.
    • Remediation backlog: Resend logs currently emit recipient addresses, and SMTP failure logs currently emit recipients and subjects.
  • Outbox cleanup & state semantics:
    • Current hourly cleanup deletes sent outbox rows without an age threshold; unsent records have no age-based expiry.
    • Email outbox data remains confidential after SMTP submission until cleanup removes the row.
    • Provider acceptance, cleanup, and email-state changes must never be presented as confirmation of the underlying business operation.