Critical emails drive your product experience: password resets, magic links, invoices, invitations, security alerts, export links, receipts. If they don’t arrive—or land in spam—users get locked out, payments fail, and trust erodes. Deliverability isn’t just a marketing concern; it’s core application reliability.
This guide explains how to design reliable transactional email for a SaaS product. We’ll cover domain strategy, SPF, DKIM, DMARC, bounce handling, suppression lists, monitoring, content choices, and the internal tools you should build to keep things healthy. Where helpful, you’ll find realistic prompts to build those tools on YeshBe, a platform for building software with AI via natural language.
Separate transactional from marketing at the domain level
Start by separating stream and identity. Transactional and product notifications are not the same as promotional email. Keeping them on distinct subdomains:
- Lets you protect transactional reputation from marketing mistakes.
- Makes DMARC policy tuning less risky.
- Simplifies monitoring and provider configuration.
Common patterns:
- Transactional: mail.yourapp.com or notify.yourapp.com
- Marketing: news.yourapp.com or updates.yourapp.com
Use a recognizable, consistent From name and address for each stream (for example, “YourApp Notifications
Authentication fundamentals: SPF, DKIM, and DMARC
Deliverability starts with authenticated identity. Three DNS-based standards work together to prove who is allowed to send and how alignment should be enforced.
SPF: authorize sending hosts
Sender Policy Framework (SPF) declares which servers can send mail for your domain. Your email provider will give you an include directive. Publish it on your sending domain or root domain depending on alignment strategy.
Type: TXT Name: mail.yourapp.com Value: v=spf1 include:spf.yourprovider.com -all TTL: 3600
Notes:
- Use -all (fail) once you’re certain only approved senders are in your policy. Use ~all (softfail) while testing.
- Avoid chaining too many includes; DNS lookups are limited. If you use multiple providers, work to consolidate policies.
DKIM: sign messages with domain keys
DomainKeys Identified Mail (DKIM) cryptographically signs each message so receivers can verify content and sender identity. Your provider generates a selector and public key.
Type: TXT Name: s1._domainkey.mail.yourapp.com Value: v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFA... (public key) TTL: 3600
Recommendations:
- Use a dedicated selector per sending domain, such as s1, and rotate keys periodically.
- Ensure DKIM signs the same domain that appears in your From address (or is at least organizationally aligned for DMARC).
DMARC: align identity and set policy
Domain-based Message Authentication, Reporting & Conformance (DMARC) tells receivers what to do if SPF and/or DKIM fail, and provides reporting for analysis. Start with a monitoring policy, then tighten over time.
Type: TXT Name: _dmarc.mail.yourapp.com Value: v=DMARC1; p=none; rua=mailto:dmarc-reports@yourapp.com; fo=1; adkim=s; aspf=s TTL: 3600
Key fields:
- p: policy. Start with none, then move to quarantine, and eventually reject once alignment is clean and stable.
- rua: aggregate report address (use a dedicated inbox or parser).
- adkim/aspf: alignment mode. s (strict) is safest for transactional subdomains you fully control.
Choose sending identity and alignment deliberately
Deliverability depends on alignment: the domain in the visible From address should match (or be in the same organizational domain as) the DKIM signing domain and the SPF-validated domain. To simplify alignment, send transactional mail from the same subdomain you authenticate (for example, From: notifications@mail.yourapp.com, DKIM: s1._domainkey.mail.yourapp.com, SPF: mail.yourapp.com).
Provider setup: API vs SMTP, IPs, and link branding
Most modern providers offer both SMTP and REST APIs. Prefer the API for richer event data and easier authentication. Consider a dedicated IP only if you have steady volume; otherwise, reputable shared pools can work well.
Configure link/asset tracking domains (sometimes called link branding) to a subdomain you control (for example, t.mail.yourapp.com) so every link in your messages aligns with your brand’s domain structure.
Warm up gradually and keep behavior consistent
New domains and IPs build reputation over time. Ramp volume gradually, keep templates stable, and avoid sudden spikes. Consistency in From name, subject style, and sending cadence helps filters learn your normal patterns.
Design product templates for deliverability and clarity
- Include a plain-text part alongside HTML. Many providers and clients factor this into spam scoring.
- Use clear subjects that reflect the message purpose: “Your YourApp sign-in code” beats hype-driven phrasing.
- Show your brand (logo, colors), but keep HTML simple. Overly complex or heavy templates can hurt deliverability.
- Include a physical mailing address and unsubscribe only for marketing or promotional emails. For purely transactional mail, offer notification preferences instead of global unsubscribe.
- Keep links consistent (same domain family) and avoid URL shorteners.
Build the event pipeline: deliveries, bounces, complaints, opens, clicks
Deliverability is not “set and forget.” Your app needs to ingest provider events, store them, and act on them. Typical events include delivered, bounced, complained (spam), dropped, deferred, opened, clicked.
At minimum, implement:
- Webhook endpoint to receive provider events
- Idempotent processing with signature verification
- Event store keyed by message ID
- Suppression list logic that deactivates bad addresses
- Operator dashboard to inspect logs and fix issues
On YeshBe, build an internal “Email Events” service and dashboard:
{"name":"Email Events and Deliverability Dashboard","requirements":["Create a secure webhook endpoint to receive JSON events from our email provider (deliveries, bounces, complaints, opens, clicks). Verify provider signatures.","Persist events with fields: provider_message_id, event_type, timestamp, recipient, subject, stream (transactional/marketing), metadata (tenant_id, user_id, template), raw_payload.","Implement idempotency using provider_message_id + event_type.","Build an Email Log UI with filters (recipient, event_type, template, date range, stream) and detail view of headers + payload.","Add a Suppression List: store suppressed recipient, reason (hard_bounce, complaint, manual), first_seen, last_seen.","When receiving hard_bounce or complaint events, automatically add to Suppression List and prevent future sends to that recipient (except manual override).","Provide an Admin action: remove from suppression after address verified.","Add metrics cards: 7-day delivery rate, bounce rate, complaint rate, top templates by volume, domains with most bounces."]}Handle bounces correctly: soft vs hard
Not all bounces are equal:
- Hard bounces: permanent failures (nonexistent mailbox, domain doesn’t exist). Suppress immediately—no further attempts.
- Soft bounces: temporary failures (mailbox full, rate limited, transient DNS issues). Implement exponential backoff retries and cap attempts.
Maintain a mapping from provider-specific codes to your canonical categories. Offer operators a way to reclassify if needed. When a user fixes an email address, allow a safe retry.
Process complaints and feedback loops
Spam complaints are strong negative signals. When a complaint event arrives, add the address to your suppression list and halt all non-essential sends. If the complaint arose from a noisy notification type, consider making that notification opt-in or batched.
Secure your ingest: signatures, IP allowlists, and replay protection
- Verify webhook signatures according to your provider’s guidance.
- Store a hash of event ID and timestamp to prevent replay.
- Use a queue between the HTTP endpoint and processing worker to absorb spikes without dropping events.
Implement notification preferences and digests
For product notifications, give users and organizations control over frequency and channels (email, in-app, SMS). Preferences reduce complaints and perceived spam. Offer digests for noisy events.
Build a preferences center with YeshBe:
{"name":"Notification Preferences Center","requirements":["Per-user and per-organization defaults for notification types: security_alerts, billing, exports_ready, comments, mentions, project_updates.","Support frequencies: off, instant, hourly_digest, daily_digest.","Respect preferences at send time; include a manage-preferences link in transactional emails.","Admin override: tenant-level policy that enforces certain critical notifications.","Audit log: record who changed what, when."]}DMARC reporting: monitor and tighten policy over time
DMARC aggregate reports help you understand who’s sending mail claiming to be you, and how SPF/DKIM alignment fares across receivers. Start at p=none, review reports, fix misalignment, then move to stricter policies.
Create a lightweight DMARC report viewer on YeshBe:
{"name":"DMARC Aggregate Report Viewer","requirements":["Upload or ingest DMARC XML aggregate reports via IMAP/POP webhook or manual upload.","Parse records to summarize by source IP, provider, pass/fail counts for SPF and DKIM, alignment results, and subdomain breakdown.","Trend charts of pass rates and sources over time; flag new sources.","Policy helper: suggest when it’s safe to move from none → quarantine → reject for a subdomain."]}Tenant-aware sending and white-label scenarios
If your SaaS sends on behalf of customers (for example, a client portal that emails their customers), you need per-tenant domain verification and DKIM. Avoid sending their messages from your root domain; instead, support verified tenant domains or subdomains.
- Per-tenant domain onboarding: generate DKIM DNS records and a tracking CNAME for each tenant to publish in their DNS.
- Alignment checks: only allow From addresses that match the verified domain.
- Fallback: if a tenant hasn’t verified, send from a neutral domain like tenantname.notifications.yourapp-mail.com with clear branding.
YeshBe prompt for a tenant domain onboarding flow:
{"name":"Tenant Email Domain Verification","requirements":["Allow a tenant admin to add a sending domain.","Generate DKIM selector and public key; show required DNS records (TXT for DKIM, CNAME for link tracking).","Check DNS until verified, then activate domain for sending.","Validate From addresses at send time; block mismatched domains.","Tenant-level metrics: deliverability by domain, recent bounces, complaint events."]}Suppression lists: the guardrail between intent and send
Your suppression list decides whether an intended send should proceed. Maintain reasons (hard_bounce, complaint, manual, provider_block), “first_seen” and “last_seen” timestamps, and a way to scope suppression per tenant when you send on behalf of many customers.
Integrate suppression checks at send time so callers see a meaningful response (for example, “NotSent: suppressed-hard-bounce”). Provide a way to lift suppression after a user verifies a new address or an operator confirms recovery.
Retry and queueing strategy
- Soft bounces: retry with exponential backoff up to a reasonable cap; annotate reasons and intervals.
- Deferred events (temporary receiver issues): requeue with jitter to avoid thundering herds.
- Hard bounces and complaints: no retries; suppress.
Safety for sensitive emails
- Magic links: short expiry, single-use tokens, and domain-bound URLs. Avoid embedding secrets directly in email.
- Security alerts: rate-limit sends per user to avoid floods that look spammy and frustrate users.
- Invoicing and PII: include only what’s necessary; prefer authenticated links to full details.
Observability: measure what matters and alert early
Track health by stream and by template:
- Delivery rate (delivered / attempted)
- Bounce rate and breakdown hard vs soft
- Complaint rate (very low is the goal)
- Top domains by failure (for targeted debugging)
- Time-to-deliver percentiles
Set alerts on sudden changes. Make it easy for support to answer, “Did we send it? When? What happened?” A searchable log with event timelines solves most tickets quickly.
On YeshBe, extend the Email Log with alerts:
{"name":"Deliverability Alerts","requirements":["Background job that computes rolling metrics per stream and template.","Threshold rules: if bounce rate or complaint rate increases compared to baseline, create an incident in the dashboard and notify on-call.","Show recent changes (new template, From change, DNS changes) to aid diagnosis."]}Testing: before and after you flip the switch
- DNS checks: verify SPF includes are valid and under lookup limits; confirm DKIM records resolve; confirm DMARC record exists with intended policy.
- Alignment tests: send sample messages; confirm From, Return-Path, and DKIM d= domain alignment.
- Content sanity: ensure templates include both HTML and text; links use your branded tracking domain; Reply-To is correct.
- Webhook dry run: simulate provider events into your endpoint; verify idempotency and signature checks.
- Suppression logic: mark an address as suppressed and confirm the app refuses to send.
- End-to-end flows: password reset, magic link, invite acceptance, invoice. Confirm time-to-deliver is within expectations.
Common pitfalls and how to avoid them
- Mixed identities: From domain doesn’t match DKIM/SPF domain. Use consistent subdomains for sending and signing.
- Forgotten DNS TTLs: remember propagation time when rotating keys or changing providers.
- Unverified tenant domains: prevent sending on behalf of customers until DNS is verified.
- One giant “notifications” type: split noisy events and offer digests to reduce complaints.
- No operator tools: without an email log and suppression manager, support can’t help users who insist “I didn’t get it.”
A minimal, reliable implementation plan
- Pick domains: mail.yourapp.com for transactional; news.yourapp.com for marketing.
- Set DNS: SPF (include provider), DKIM (selector + key), DMARC (p=none, rua set).
- Provider integration: use API, configure link branding (t.mail.yourapp.com).
- Event pipeline: webhook with signature checks, event store, suppression list.
- Templates: standardize From, subject, HTML+text, consistent links.
- Preferences: per-user toggles and digests for noisy types.
- Dashboards: searchable logs, metrics, and alerts.
- Iterate DMARC: monitor reports, fix alignment, move to quarantine, then reject.
Example: building a password reset flow that won’t get stuck in spam
A practical walkthrough:
- Template: subject “Reset your YourApp password”, short copy, one secure button, fallback link in plain text. Include text part.
- Link: sign a token with short expiry and single use; tie to user ID and IP metadata; use your branded domain.
- Send: From notifications@mail.yourapp.com signed with DKIM for mail.yourapp.com; SPF includes provider; DMARC p=none initially.
- Monitor: confirm delivered event, time-to-deliver under expected seconds range; if bounce, inspect code and update suppression.
- Support: if a user claims non-receipt, your log shows event history and reason; offer fallback such as SMS or a new address.
Scaling considerations
- Sharding by stream: separate credentials and rate limits for transactional vs marketing.
- Multi-region: if your app is regional, consider provider regions and latency; keep DNS and DKIM records consistent per region.
- Key rotation: maintain two DKIM selectors (s1 active, s2 standby). Rotate without downtime by updating signing config then removing old DNS.
Where YeshBe fits
YeshBe is a platform for building software through natural language. It doesn’t send email on your behalf, but it makes it fast to build the internal tools you need: event ingestion services, suppression list management, tenant domain onboarding, operator dashboards, and notification preference centers. You describe the workflows, data, and UI you want; YeshBe helps you assemble a working application you can iterate on.
Final checklist
- Separate transactional and marketing sending domains
- SPF published and limited to real senders
- DKIM enabled and aligned with From domain
- DMARC at p=none with reports flowing; plan to tighten
- Link branding on a domain you control
- Webhook + event store + suppression logic in place
- Operator dashboard to search and diagnose sends
- Notification preferences and digests for noisy types
- Alerts on bounce/complaint anomalies
- Documented runbooks for key templates (resets, invoices, invites)
Deliverability is an engineering concern because it’s part of the user journey. Put identity, authentication, and event handling on solid footing, and your emails will quietly do their job: help users succeed without getting stuck in spam or disappearing altogether.