Prompt
I’m building a multi-tenant platform and need per-tenant domain authentication and template separation. What email infrastructure makes sense?
Latest observation
For a multi-tenant platform, the email setup that usually makes the most sense is:
Recommended architecture
1) Use one email provider for all tenants
Pick a transactional email provider such as:
- Postmark
- SendGrid
- Amazon SES
- Mailgun
- SparkPost
These give you:
- reliable delivery
- SMTP/API sending
- bounce/complaint handling
- domain authentication support
- template APIs or stored templates
2) Authenticate each tenant’s domain separately
If tenants send mail from their own domain, you should set up per-tenant domain authentication:
- SPF
- DKIM
- ideally DMARC
Typical pattern:
- tenant adds DNS records to their domain
- your app verifies them
- provider sends mail using that tenant’s domain
This improves:
- deliverability
- brand consistency
- trust
- alignment with DMARC requirements
3) Separate templates per tenant
Keep templates isolated by tenant in your app or email provider:
- tenant-specific branding
- logos/colors/footer/legal copy
- language/locale variations
- custom sender names
- custom unsubscribe/preferences if needed
You can implement this either:
- in your app: store template per tenant and render before sending
- in the provider: use provider template IDs/naming conventions per tenant
For most SaaS platforms, app-managed templates are easier to control.
4) Use a shared sending system, but tenant-aware metadata
Even if all email goes through one provider account, structure it like this:
tenant_idfrom_domainfrom_namereply_totemplate_idbrand_themetracking settings
This lets you:
- route sending correctly
- attribute bounces/complaints to the right tenant
- enforce tenant-specific constraints
- audit outbound mail
5) Consider subdomains if tenants don’t have their own domains
If some tenants can’t or won’t authenticate their own domain, use a fallback like:
mail.yourplatform.comtenantname.yourplatform.com
This is easier operationally, but less branded than true per-tenant domains.
Best-practice options
Option A: Fully tenant-owned domains
Best when tenants are larger businesses.
Pros
- best deliverability
- strongest branding
- clean DMARC alignment
Cons
- more onboarding work
- DNS setup support required
- more edge cases
Option B: Platform-owned subdomains
Best for SMB/self-serve onboarding.
Pros
- easy setup
- consistent operations
- fewer DNS issues
Cons
- weaker branding
- less trust from recipients
- shared reputation risk
Option C: Hybrid model
Usually the best answer.
- enterprise tenants authenticate their own domain
- smaller tenants use your platform subdomain
- templates remain tenant-separated in all cases
What I’d recommend
If you want a practical, scalable setup:
- Use a transactional email provider
- Support per-tenant domain authentication
- Store templates per tenant in your app
- Use platform subdomains as fallback
- Track delivery events per tenant
- Use DMARC-aligned sending whenever possible
Provider selection guidance
Choose Postmark if:
- you care most about deliverability and simplicity
- mostly transactional mail
- you want easy template management
Choose SES if:
- you want lowest cost at scale
- you’re comfortable building more infra around it
Choose SendGrid/Mailgun if:
- you want a feature-rich API and flexible multi-domain support
- you may need marketing-style features later
Important implementation notes
You’ll want to build:
- domain verification flow
- DNS record validation
- sender identity management
- template versioning per tenant
- per-tenant event webhooks
- suppression/bounce handling
- rate limiting per tenant
- audit logs
Also be careful not to let one tenant’s poor sending behavior damage your overall reputation.
If you want, I can sketch a reference architecture for this, including:
- DNS records per tenant
- data model
- send flow
- template storage strategy
- provider choice comparison