Auth verification, password reset, and product notifications call a shared
mailService. The generator keeps only the selected implementation and packages.
Selection and configuration
| Adapter | Configuration | Use case |
|---|---|---|
disabled | None | Run local flows that do not require delivery |
resend | RESEND_API_KEY, EMAIL_FROM | Managed transactional email |
smtp | Host, port, secure flag, optional user/password | Private SMTP or compatible providers |
cloudflare-email | NEXTDEVTPL_EMAIL binding, EMAIL_FROM | Cloudflare Workers |
The disabled adapter returns an explicit configuration error when called. Choose a delivery adapter for verification and password reset flows.
Main code
| Path | Purpose |
|---|---|
src/core/services/mail.ts | Shared message and capability contract |
src/adapters/mail | Provider implementations |
src/services/mail.ts | Selected mail instance |
src/features/mail/templates | React Email templates |
src/features/mail/server.ts | Product mail entry points |
src/lib/auth | Verification and reset triggers |
Add an email
- Create a template in
src/features/mail/templates. - Build sender, recipients, subject, HTML, and plain text in
src/features/mail/server.ts. - Deliver it through
mailService.send(). - Test missing configuration, provider failure, and success without logging content or secrets.
Before production, verify the sender domain, SPF/DKIM/DMARC, and that auth links use the production domain.