Email

Email

Email delivery uses Resend and React Email templates.

Main files

PathPurpose
src/features/mail/client.tsResend client setup
src/features/mail/actions.tsEmail send actions
src/features/mail/utils.tsEmail helpers
src/features/mail/templatesReact Email templates
src/test/mail/newsletter.test.tsEmail-related test coverage

Environment variables

VariablePurpose
RESEND_API_KEYAuthenticates with Resend
EMAIL_FROMSender address displayed to users

Example:

RESEND_API_KEY="re_xxxxxxxxx"
EMAIL_FROM="NextDevTpl <noreply@example.com>"

Templates

Templates are React components. Current examples include:

TemplatePurpose
welcome-email.tsxWelcome/onboarding email
primary-action-email.tsxGeneric action email with a button

When editing templates, keep copy short and avoid relying on app-only CSS. Email clients have limited CSS support.

Local behavior

If Resend is not configured, email-dependent features should be treated as unavailable. Use email/password flows that do not require delivery first, then enable Resend when testing verification and reset flows.

On this page