---
id: sendgrid
name: SendGrid
version: 1.0.0
summary: |
  External email delivery platform used by BookWorm to submit rendered
  transactional emails over authenticated SMTP.
scope: external
owners:
  - platform-engineering-team
services:
  - id: sendgrid-api
    version: 1.0.0
flows:
  - id: user-checkout
    version: 1.0.0
badges:
  - content: External
    backgroundColor: purple
    textColor: purple
    icon: GlobeAltIcon
---

## System Purpose & Boundary

SendGrid provides BookWorm's external SMTP email relay boundary within the [[domain|platform]] domain, offloading internet mail routing, sender reputation, and downstream ISP delivery. Only [[system|notification-system]] integrates with SendGrid at runtime to submit rendered order lifecycle emails. Owning BookWorm's notification state, managing retry queues, and dictating order or payment status are explicitly out of scope.

:::note
SendGrid acceptance confirms only that the provider accepted the SMTP submission—it does not guarantee recipient inbox delivery or confirm that the underlying business order succeeded.
:::

## Contained Capabilities

| Service / Agent           | Role in System                                                                        | Primary Data Store          | Interaction Style (Sync / Async) |
| :------------------------ | :------------------------------------------------------------------------------------ | :-------------------------- | :------------------------------- |
| [[service\|sendgrid-api]] | External email delivery integration boundary accepting authenticated SMTP submissions | External (Provider-managed) | Sync (SMTP submission)           |

## External Interactions & Trust Boundaries

- **Sole BookWorm consumer:** [[service|notification-api]] submits rendered MIME emails over TLS-encrypted SMTP in publish environments (and uses a local test inbox during development).
- **Resilience & dead-lettering:** [[system|notification-system]] retains full ownership of 24-hour message-ID deduplication, bounded client retries, and dead-letter routing when SendGrid is unavailable or throttles requests.
- **Credential & PII boundary:** API keys and sender secrets are injected strictly via runtime secret configuration; recipient addresses and message bodies are never logged in routine telemetry.

## System Visualizations

### System Context

<ContextDiagram />

### Component Topology

<NodeGraph />

### Architecture Decisions

<ADRTable />

## Related Documentation

- [[flow|user-checkout]] — Checkout flow triggering transactional order emails.
- [[system|notification-system]] — Internal email rendering and retry boundary.
- [[service|sendgrid-api]] — External SMTP integration details and credential practices.
- [[doc|domains/bookworm/subdomains/platform/engineering/platform-integration-boundaries]] — Platform external integration boundaries.
