Prompt
I'm building a B2B product and need emails to scale from a few hundred sends a day to millions without redoing everything. What should I choose?
Latest observation
If you want to go from hundreds of emails/day to millions/day without redesigning later, choose an email setup that is provider-agnostic, queue-based, and event-driven from day one.
Best-practice choice
Use:
- An ESP API for delivery at first (e.g. SendGrid, Postmark, SES, SparkPost, Mailgun)
- A message queue / job system for all outbound email work
- A dedicated email service/module in your backend
- Webhook processing for bounces, complaints, opens/clicks, deliveries
- Domain separation and reputation management from the start
What this means in practice
1) Don’t send emails synchronously from your app
Instead of:
- user signs up → app sends email immediately
Do:
- user signs up → app writes an email job to a queue
- worker sends email asynchronously
- retries happen in the background
- failures don’t block your product
This gives you:
- burst handling
- retries
- rate limiting
- easier provider switching
- better observability
2) Build an internal email abstraction
Create a single internal interface like:
sendEmail(type, recipient, variables, metadata)
Under the hood, that service handles:
- template selection
- personalization
- provider API calls
- idempotency
- retries
- provider failover later if needed
That way, when you outgrow one vendor, you swap the adapter, not the product.
3) Separate transactional and marketing email
These have different requirements and should not share the same sending path:
- Transactional: signup confirmations, password resets, alerts
- Marketing: campaigns, newsletters, nurture sequences
Why:
- different compliance rules
- different unsubscribe logic
- different deliverability/reputation needs
- different infrastructure scaling patterns
4) Use a reputable ESP for sending, not raw SMTP from your own servers
For scale, deliverability, and reputation, use an ESP or cloud provider:
- Amazon SES: cheapest and highly scalable, more engineering-heavy
- Postmark: excellent for transactional email, easier to use
- SendGrid/Mailgun/SparkPost: good APIs and features
If you expect large volume and want low cost with flexibility:
- SES + your own queue + your own email service abstraction is often the most scalable long-term option.
5) Make your system event-driven
Email should be triggered by events like:
user_signed_upinvoice_paidtrial_expiringpassword_reset_requested
Then route those events into:
- queue
- template renderer
- sender
- webhook processor
This makes it much easier to scale workflows later.
What to avoid
Avoid:
- hardcoding provider logic throughout the app
- sending directly in request/response lifecycle
- relying on one giant monolithic “email function”
- mixing marketing and transactional traffic
- ignoring bounces/complaints/unsubscribes
- using a single shared domain for everything
A scalable architecture
A good setup looks like:
- App emits event
- Email service decides template + provider
- Job goes to queue
- Worker sends email via ESP
- Webhooks update delivery/bounce/complaint status
- Analytics/reputation system monitors health
Recommended stack by stage
Early stage
- Provider: Postmark or SES
- Queue: SQS, RabbitMQ, Sidekiq, Celery, BullMQ
- DB: store email jobs + statuses
- Templates: stored in your app or provider
Growth stage
- Add:
- multiple sending domains
- dedicated IPs if needed
- bounce/complaint suppression lists
- provider abstraction
- rate limiting per campaign/type
Scale stage
- Multi-provider failover
- Separate pipelines for transactional vs marketing
- Dedicated reputation monitoring
- Regional sending strategy if necessary
- More advanced workflow orchestration
My direct recommendation
If you want the safest “won’t regret it later” choice:
- Use an internal email service abstraction
- Send asynchronously through a queue
- Start with Amazon SES or Postmark
- Keep transactional and marketing email separate
- Process webhooks for delivery/bounce/complaint events
If you want, I can also give you:
- a reference architecture diagram,
- a vendor comparison table, or
- a minimal implementation plan for your stack (Node, Python, Go, etc.).