Email

LaunchFast uses Resend as the email provider for transactional emails (verification codes, password resets, notifications). During development, emails are logged to the terminal instead of being sent.

Development mode

When no RESEND_API_KEY is set, all emails are printed to the terminal. This means you can complete signup, password reset, and other email-dependent flows without any external service during development.

Production setup

  1. Create a Resend account and generate an API key
  2. Set the secret on Fly:
    fly secrets set RESEND_API_KEY="re_..." --app your-app-name
  3. Add and verify a custom sending domain in Resend (DNS records)
  4. Update the from address in app/utils/email.server.ts to use your verified domain

Configuration

Email sending logic lives in app/utils/email.server.ts. This is where you configure the sender address, customize email templates, and control the development fallback behavior.

Email templates

LaunchFast uses React Email for composing HTML emails with React components. Templates live alongside the email utility and receive data as props, making them type-safe and easy to preview.

Error handling

The sendEmail function returns a result object with either a status: 'success' or status: 'error' with an error message. Always check the result and handle failures gracefully — email delivery is not guaranteed.

Testing with MSW

For automated tests, MSW mocks in test/mocks intercept email API calls so tests run without real service credentials. This keeps tests fast and offline-capable.

Related