# Transactional Email and Notifications

> Send password resets, receipts and alerts reliably through email providers, push and in-app channels. Free notes, key concepts, resources and a mini project.

Canonical: https://www.internhack.in/roadmaps/tracks/backend/email-notifications
Last updated: 2026-11-28

Send password resets, receipts and alerts reliably through email providers, push and in-app channels.

Intermediate · about 4 hours · difficulty 2/5

Learn first: [DNS and Domain Names](https://www.internhack.in/roadmaps/tracks/backend/dns), [Resource-Oriented REST APIs](https://www.internhack.in/roadmaps/tracks/backend/rest-api-design)

Signup confirmations, password resets, receipts and alerts are all backend responsibilities. They look trivial ("just send an email") but reliability and deliverability take real care.

### Use a provider, not your own mail server

Services such as Amazon SES, Postmark, Resend, SendGrid or Mailgun expose an HTTP API or SMTP relay. They handle IP reputation, bounces and complaints. Running your own SMTP server for product email is almost never worth it.

### Deliverability basics

Inbox providers decide whether your mail is spam largely from DNS records on your sending domain:

- **SPF** lists which servers may send for your domain.
- **DKIM** cryptographically signs each message.
- **DMARC** tells receivers what to do when SPF or DKIM fail and where to send reports.

Separate **transactional** mail (resets, receipts) from **marketing** mail, ideally on different subdomains, so a newsletter complaint does not hurt your password resets.

### Send asynchronously

Never call the email API inside the request that the user is waiting on. Enqueue a job and let a worker send it with retries. Store a record of what was sent so support can answer "did the reset email go out?".

### Other channels

- **Web and mobile push** (Web Push, FCM, APNs) for timely alerts.
- **In-app notifications** stored in your database with a read flag.
- **SMS** via providers like Twilio, used sparingly because it costs money per message.

A small **notification service** that picks channels based on user preferences keeps this logic out of your business code.

### Pitfalls

- Password reset links that never expire or can be reused.
- Sending to users who unsubscribed, which is both bad practice and often illegal.

You are ready to move on when your app sends templated emails from a queue, your domain passes SPF, DKIM and DMARC checks, and users can control which notifications they receive.

## Key concepts

- **Email provider APIs and SMTP**
- **SPF, DKIM and DMARC**
- **Templating emails**
- **Sending from a background queue**
- **Bounces and complaints**
- **Push notifications (FCM, APNs, Web Push)**
- **In-app notification feeds**
- **User notification preferences**

## Mini project

Build a password reset flow that enqueues a templated email, uses a single-use token that expires in 30 minutes, and logs each send with its provider message id.

## Check yourself

Your reset emails are landing in spam. Which three DNS records do you check first, and what does each one prove?

## Free resources

- [What is a DMARC record?](https://www.cloudflare.com/learning/dns/dns-records/dns-dmarc-record/) (Cloudflare)
- [Amazon SES Developer Guide](https://docs.aws.amazon.com/ses/latest/dg/Welcome.html) (AWS)
- [MDN: Push API](https://developer.mozilla.org/en-US/docs/Web/API/Push_API) (MDN)

Previous: [File Storage and Uploads with Object Storage](https://www.internhack.in/roadmaps/tracks/backend/file-storage-uploads) · Next: [Payments, Webhooks and Idempotency](https://www.internhack.in/roadmaps/tracks/backend/payments-webhooks)

## More in Files, Email and Payments

- [File Storage and Uploads with Object Storage](https://www.internhack.in/roadmaps/tracks/backend/file-storage-uploads)
- [Transactional Email and Notifications](https://www.internhack.in/roadmaps/tracks/backend/email-notifications)
- [Payments, Webhooks and Idempotency](https://www.internhack.in/roadmaps/tracks/backend/payments-webhooks)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Backend Developer Roadmap](https://www.internhack.in/roadmaps/tracks/backend)
