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

  1. Grab a Resend API key and set RESEND_API_KEY.
  2. Set EMAIL_FROM (verified domain), EMAIL_FROM_NAME, and optionallyADMIN_EMAIL.
  3. Point NEXT_PUBLIC_APP_URL at 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-tools to manually mark emails verified if you are offline.
  • Point EMAIL_FROM to onboarding@resend.dev for quick sandbox testing while your domain is pending verification.
  • Keep ADMIN_EMAIL populated 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_NAME so customers immediately recognize your company name in their inbox.
  • Set up DMARC + SPF + DKIM once you map the project to your production domain.