Skip to content
You're viewing documentation for v1.0.1. It may be out of date.Go to latest
Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Build a production send pipeline

Validate before queueing, preserve durable state, and use retries and fallback without hiding delivery uncertainty.

The core SDK owns one process-local delivery attempt. Your application owns durable queueing, persisted idempotency, and recovery after process failure.

Construct explicit routes

Choose the backup from the field support and capability tables. SMTP is not a universal backup because it rejects attachments, tags, metadata, and schedules.

Validate before accepting work

Use the same public no-network boundary as send before committing a job to your queue.

Send with a stable idempotency key

The key is effective only where the selected adapter supports it. Persist your own business-level deduplication before invoking the SDK.

Handle delivery certainty

  • Retry not_sent failures when retryable is true.
  • Let configured fallback advance after terminal not_sent failures.
  • Stop on unknown by default and reconcile provider state before retrying.
  • Opt into onUnknownDelivery: "continue" only when a duplicate is safer than a missed message.

Record safe facts

Use hooks or observabilityPlugin for adapter, attempt, stable error code, duration, and redacted message facts. Avoid bodies, addresses, credentials, idempotency keys, provider response bodies, URLs, and filesystem paths.

Use a durable integration when needed

Convex Email provides queue state, attempts, cancellation, test-mode redirection, and webhook history for Convex applications.

Troubleshoot failures

Inspect typed errors and delivery classification.

Last updated on