Quickback Docs

Email Configuration

Configure outbound email for auth flows in quickback.config.ts, and how the email provider is auto-wired.

Configure how the generated Worker sends auth email (OTP, verification, invitations) in quickback.config.ts. Start at Configuration for the rest of the file.

Email Configuration

Configure email delivery for authentication emails (verification, password reset, invitations). Inbound mail (Email Routing or SES → a Worker handler) is a separate surface — see Email (Inbound) (defineEmail). This section is outbound only.

Cloudflare Email Sending is now in public beta and is Quickback's default transport for Cloudflare deploys. The Workers send_email binding is zero-config — no API keys, no third-party accounts. AWS SES remains supported as an explicit opt-in (email.provider: 'aws-ses') for non-Cloudflare runtimes or existing SES setups.

// Cloudflare Email Service (default) — uses send_email binding, no API keys needed
email: {
  from: "noreply@example.com",
  fromName: "My App",
},

// AWS SES — requires AWS credentials set as Wrangler secrets
email: {
  provider: "aws-ses",
  region: "us-east-2",
  from: "noreply@example.com",
  fromName: "My App",
},
FieldTypeDefaultDescription
provider"cloudflare" | "aws-ses""cloudflare"Email transport
fromstring"noreply@example.com"Sender email address
fromNamestring"{name} | Account Services"Sender display name
regionstring"us-east-2"AWS SES region (aws-ses only)

Auto-wiring

For the Cloudflare provider (the default), the compiler automatically:

  • Emits [[send_email]] EMAIL into wrangler.toml
  • Generates src/lib/cloudflare-email.ts
  • Wires sendResetPassword, sendVerificationEmail, sendInvitationEmail, etc. into Better Auth
  • Types the binding with Cloudflare's native SendEmail / EmailSendResult contract ({ email, name }, replyTo, and contentId on Workers). The REST helper remains a separate { address, name } / reply_to / content_id contract.
  • Anchors each authentication delivery to executionCtx.waitUntil(...). The background promise records a structured generic failure and stays rejected; outside a Worker request, the callback returns the observed promise for the caller to await. Every Cloudflare Email callback is wired through that shared scheduler exactly once, so no auth action can bypass failure observation or double-schedule the send. Provider error bodies are never written to generated logs.

…whenever any auth surface needs to send mail — emailAndPassword.enabled, the emailOtp / magicLink / organization plugins — or you set the top-level email: {…} config. You don't need to add bindings.sendEmail by hand for the standard cases.

The public SES plugin readiness endpoint returns only emailConfigured and provider; sender addresses and region are not disclosed. Use /api/v1/auth/email-status for the provider-independent readiness check.

Cloudflare Email Routing setup is required. The binding alone does not deliver mail. Enable Email Routing on the sending zone and add at least one verified destination address (Cloudflare docs). Otherwise sends fail at runtime even with the binding present and the /api/v1/auth/email-status check passing locally.

On this page