Documentation
Email System
Transactional emails (verification, welcome, password reset, subscription updates) are powered by Resend with beautifully formatted HTML templates stored in src/lib/email.ts.
Capabilities
- Email verification on sign-up.
- Password reset requests and confirmations.
- Welcome emails after onboarding.
- Subscription lifecycle notifications (confirmation, cancellation, payment failures).
- Console logging fallback for development.
Configuration
- Grab a Resend API key and set
RESEND_API_KEY. - Set
EMAIL_FROM(verified domain),EMAIL_FROM_NAME, and optionallyADMIN_EMAIL. - Point
NEXT_PUBLIC_APP_URLat the domain you want to appear inside links.
Development friendly
If RESEND_API_KEY is missing the project prints every verification or password reset URL directly to your terminal so you can click it instantly.
Templates
Each helper in src/lib/email.ts returns a full HTML string. Update the markup or switch to React email components if you prefer:
sendVerificationEmail(email, token)sendPasswordResetEmail(email, token)sendWelcomeEmail(email, name)sendSubscriptionConfirmationEmail(email, name, plan, periodEnd)
Testing Tips
- Use
/dev-toolsto manually mark emails verified if you are offline. - Point
EMAIL_FROMtoonboarding@resend.devfor quick sandbox testing while your domain is pending verification. - Keep
ADMIN_EMAILpopulated so you can quickly route critical billing notifications internally.
Deliverability
- Verify your sending domain and add the DNS records Resend provides.
- Use branded
EMAIL_FROM_NAMEso customers immediately recognize your company name in their inbox. - Set up DMARC + SPF + DKIM once you map the project to your production domain.