Skip to content
Early bird + Black Friday · 73% off

Get ZeroDirs for $179 $49

Claim $49 deal

Email

providers.email in site.config.ts picks the transport — 'cloudflare', 'resend' or 'console'. Every message lands in email_outbox first.

The default: the EMAIL binding, no API key. It needs the Workers Paid plan; mail to a verified destination address is free on any plan.

  1. Enable sending on the domain emailFrom will use (Cloudflare DNS zones only).

    Terminal
    pnpm exec wrangler email sending enable acme.com
    pnpm exec wrangler email sending list

    pnpm cf:setup leaves the binding out while that list is empty.

  2. Restore the binding if cf:setup dropped it, then regenerate types.

    wrangler.jsonc
    "send_email": [{ "name": "EMAIL" }]
    Terminal
    pnpm cf:typegen

    No remote: true; pnpm dev and the tests send nothing.

  3. Set the provider and the sender, on the enabled domain.

    site.config.ts
    providers: {
    email: 'cloudflare',
    emailFrom: 'Acme Directory <hello@acme.com>',
    },
    Terminal
    pnpm check:config

    A malformed sender stops at site.config.ts › providers.emailFrom: must look like "Name <addr@example.com>".

  4. Deploy with pnpm deploy or a push.

Check Where You should see
The config parses pnpm check:config site.config.ts OK — …
Nothing is missing /admin/ no email line in the report
A message left submit a test listing to yourself a receipt within a minute
The rows pnpm exec wrangler d1 execute DB --local --command "SELECT template, status, attempts, last_error, created_at, sent_at FROM email_outbox ORDER BY created_at DESC LIMIT 5" (--remote for production) sent with a sent_at, else last_error: cloudflare E_SENDER_NOT_VERIFIED, resend HTTP 403, resend HTTP 429
Per submitter /admin/listings/<id>/, “Mail to this submitter” template · status · attempts · date, and its last error
The hourly flush, locally pnpm build, pnpm exec wrangler dev, curl "http://localhost:8787/cdn-cgi/local/scheduled?cron=0+*+*+*+*"; under pnpm dev that URL answers 404 jobs: expireFeatured=0 flushOutbox=<n> … in wrangler’s log
  • A password-reset link goes out with the request that made it; the rest waits for the hourly job (twenty rows a tick).
  • After five failed attempts a row parks as failed and /admin/ says “N emails gave up after five attempts”; only “Resend” on the listing moves it.
  • Email Routing shows sent mail as dropped even when delivered; the Email Sending logs are the truth.
  • providers.adminNotify: 'same', 'cloudflare-verified' (the EMAIL binding beside Resend), 'off'. Your own mail goes to admin.email, else site.contactEmail.
Configuration A submitter sees /admin/ reports Fix
providers.email: 'console' no mail; rows sent providers.email is "console": submitters get no mail, it is only logged. (warning) Set providers.email to "resend" or "cloudflare" in site.config.ts.
'resend' without RESEND_API_KEY no mail; rows sent Missing secret RESEND_API_KEY — run: wrangler secret put RESEND_API_KEY (local: add to .env). Queued mail stays in email_outbox. (error) pnpm cf:secrets RESEND_API_KEY
'cloudflare' without the EMAIL binding no mail; rows sent nothing; only cf:setup enable the domain, restore the binding, pnpm cf:typegen, deploy
'cloudflare', domain not enabled or Workers Free pending with cloudflare E_SENDER_NOT_VERIFIED: …, failed after five tries the failed-email line enable the domain or the plan, then Resend
'resend', unverified or over the cap pending with resend HTTP 403 … or resend HTTP 429 rate limited … the same verify the domain; the cap clears itself
adminNotify: 'cloudflare-verified' without the binding your mail goes via providers.email, against its quota nothing keep the binding
emailFrom empty or malformed build stops — site.config.ts › providers.emailFrom: required when providers.email is "resend"

providers.email, providers.emailFrom, providers.adminNotify, admin.email, queue.digestHourUtc, features.accounts — providers, admin, queue, features. providers.emailFrom is required unless the provider is console, and has to be on the enabled domain.

  • wrangler.jsonc the send_email binding
  • .env.example RESEND_API_KEY
  • site.config.ts the providers block
  • Directoryscripts/
    • cloudflare-setup.ts drops the binding without a sending domain
  • Directorysrc/
    • Directoryserver/
      • Directoryemail/
        • index.ts the provider selector and adminNotify
        • outbox.ts enqueueEmail, flushOutbox, the five attempts
        • cloudflare.ts the EMAIL binding
        • resend.ts the 429 and 403 messages
        • console.ts the log line
        • Directorytemplates/
          • submitted.ts
          • approved.ts
          • rejected.ts
          • admin-new-submission.ts
          • admin-digest.ts
          • password-reset.ts
          • layout.ts the shared shell
      • jobs.ts the hourly flushOutbox
      • secrets.ts the messages /admin/ shows
    • Directoryactions/
      • submit.ts the flush after a submission
      • auth.ts the inline flush for reset links
    • Directorydb/
      • schema.ts the email_outbox table
  • Directorytests/unit/
    • email-wiring.test.ts every provider gets the binding