Skip to main content
SaaS Foundation uses Resend for transactional email. The application currently sends:
  • Admin portal invitations
  • Customer organization invitations
  • Set-password and password-reset emails

Configure Resend

Create a Resend account, generate an API key, and add it to your .env file.
The application creates the Resend client only when it needs to send an email. If RESEND_API_KEY is missing, the email operation fails with a configuration error.
Treat the API key as a secret. Do not commit it to source control or expose it in browser code.

Configure the sender

Set EMAIL_FROM to the address that recipients should see in the From field.
You can include a friendly display name as well.
If you do not set this value, SaaS Foundation falls back to onboarding@resend.dev. That address is useful for initial testing but is not a production sender.

Test with a new Resend account

While you use the default resend.dev sender, Resend only allows test emails to the email address associated with your Resend account. Attempts to send to other recipients return an error. This is enough to verify your local email integration before configuring DNS. Sign in to the application with your own email address and exercise an invitation or password flow.

Send to other recipients

To send email to customers or teammates, add a domain you own to Resend and verify it by adding the DNS records provided in the Resend dashboard. Once the domain is verified:
  1. Change EMAIL_FROM to an address on the verified domain.
  2. Restart the application so it reads the updated environment value.
  3. Send a test invitation to an address other than your own.
Resend does not require you to create each sender address separately. After a domain is verified, you can send from an address at that domain. Resend recommends choosing an address that can receive replies.
The domain in EMAIL_FROM must match the domain or subdomain you verified in Resend.
See Resend’s guides for managing and verifying domains and sender addresses.

Email implementation

Email code lives under src/lib/email/. Each email type owns its subject, content, required inputs, and Resend call. All email functions share the client and sender configuration from src/lib/email/client.ts.
Better Auth invokes the password-reset and organization-invitation email callbacks as part of its authentication workflows. SaaS Foundation owns the email content and sends it through the shared Resend client.