CoreMVP

Email

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

Account action Supabase Auth Auth email Billing event App service Resend

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.

ModeUse it forApp-owned result
mockLocal development without guest captureRuns the service without sending.
test_captureLocal or hosted lifetime onboarding proofCaptures the setup message and link for automation.
realCustomer deliverySends 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

Was this page helpful?

On this page