Prompt
I'm building app alerts that can't fail, recommend an email delivery setup
Latest observation
For app alerts that can’t fail, I’d recommend a multi-provider, event-driven email delivery setup with strong retry/fallback and observability.
Recommended architecture
1) Use a primary transactional email provider
Pick one of:
- Amazon SES — best for cost, scale, and reliability
- Postmark — best for high deliverability and simplicity
- SendGrid/Mailgun — good feature sets, but SES/Postmark are often better for critical alerts
For “can’t fail” alerts, I’d lean:
- Postmark if you want the most straightforward high-deliverability alerting
- SES if you want maximum control, scale, and low cost
2) Add a secondary fallback provider
Don’t rely on one SMTP/API provider only.
Example:
- Primary: Postmark
- Secondary: SES or
- Primary: SES
- Secondary: Postmark
Route failed sends to the fallback provider automatically.
3) Put email sends behind a queue
Never send alerts synchronously from the app request path.
Use:
- SQS / RabbitMQ / Kafka / Redis queue
- Worker service handles sending
- Retries with exponential backoff
- Dead-letter queue for failures
This prevents app latency and avoids losing alerts during transient outages.
4) Persist every alert before sending
Write alerts to a database first with a status like:
pendingsentfailedretrying
This gives you durability and auditability, and lets you recover/replay messages.
5) Implement idempotency
Make sure retries don’t create duplicate alerts:
- Generate an alert ID
- Store provider message ID
- Deduplicate on resend
6) Monitor delivery end-to-end
Set up:
- Send success/failure metrics
- Queue depth alarms
- DLQ alarms
- Bounce/complaint monitoring
- Provider uptime/status page alerts
- Alert on “notification not delivered within X minutes”
7) Verify email authentication
Essential for deliverability:
- SPF
- DKIM
- DMARC
- Dedicated sending domain
- Good bounce handling
- Warm up new domains/IPs if needed
If you want the most robust setup
A strong pattern is:
App → Database → Queue → Sender Worker → Primary Email API → Fallback Email API → Delivery tracking
with:
- retries
- DLQ
- monitoring
- audit log
- idempotency keys
Practical recommendation by use case
Best overall for critical alerts
- Postmark + SES fallback
- Queue + DB persistence
- DMARC/SPF/DKIM
- Alerting on failed delivery + DLQ
Best low-cost scalable option
- SES primary
- Postmark fallback
- Queue + retries + monitoring
Best simplest reliable setup
- Postmark primary
- Secondary SMTP/API backup
- Queue + database + monitoring
Important caveat
If these are truly can’t fail alerts, email should not be the only channel. Add at least one backup:
- SMS
- Push notification
- PagerDuty/Opsgenie
- Webhook to incident system
- In-app banner
Email is good, but not sufficient as the sole critical channel.
If you want, I can propose:
- a specific vendor stack,
- a reference architecture diagram, or
- a production-ready retry/failover design.