Your app has two email paths because account security and product onboarding have different owners. Supabase Auth handles secure account links. The app handles the billing messages that depend on your product and purchase flow.
Two paths, one clear boundary
Supabase Auth sends enabled confirmation, magic-link, recovery, and email-change messages. Configure their templates and SMTP inside your Supabase project.
The app email service builds lifetime onboarding and subscription welcome messages. In production it sends them through Resend, with deterministic idempotency keys so a retried billing event does not have to become a duplicate message.
Local work cannot accidentally email customers
App-owned email defaults to mock outside a hosted deployment. Your code still
reaches the email service, but delivery is suppressed. Hosted deployments must
choose test_capture or real; leaving the mode unset or choosing mock fails
instead of silently dropping production email.
| Mode | Use it for | App-owned result |
|---|---|---|
mock | Local development without guest capture | Runs the service without sending. |
test_capture | Local or hosted lifetime onboarding proof | Captures the setup message and link for automation. |
real | Customer delivery | Sends lifetime and subscription messages through Resend. |
These modes do not change Supabase Auth delivery. Account emails still use the SMTP provider configured in Supabase.
Billing onboarding survives retries
Guest lifetime checkout depends on email because the buyer still needs to set a
password after paying. The webhook records that delivery as
pending, sending, sent, or failed, keeps the generated setup link, and
can reclaim a stale send. Your buyer is not left with an untraceable one-shot
side effect if delivery fails midway.
Subscription welcome email follows signed-in checkout. It is sent in real
mode and suppressed in mock and test_capture, because subscription access is
proved from persisted billing state rather than an inbox.
What's next
Customize Email Templates
Choose a Delivery Mode
Test Email Behavior
Configure Production Email
Was this page helpful?