Email

Email

Auth verification, password reset, and product notifications call a shared mailService. The generator keeps only the selected implementation and packages.

Selection and configuration

AdapterConfigurationUse case
disabledNoneRun local flows that do not require delivery
resendRESEND_API_KEY, EMAIL_FROMManaged transactional email
smtpHost, port, secure flag, optional user/passwordPrivate SMTP or compatible providers
cloudflare-emailNEXTDEVTPL_EMAIL binding, EMAIL_FROMCloudflare Workers

The disabled adapter returns an explicit configuration error when called. Choose a delivery adapter for verification and password reset flows.

Main code

PathPurpose
src/core/services/mail.tsShared message and capability contract
src/adapters/mailProvider implementations
src/services/mail.tsSelected mail instance
src/features/mail/templatesReact Email templates
src/features/mail/server.tsProduct mail entry points
src/lib/authVerification and reset triggers

Add an email

  1. Create a template in src/features/mail/templates.
  2. Build sender, recipients, subject, HTML, and plain text in src/features/mail/server.ts.
  3. Deliver it through mailService.send().
  4. 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.

On this page