Open Source · MIT License
♥ Sponsor

The email sending layer
your Cloudflare stack was missing.

EmailFlare wraps Cloudflare Email Sending with a clean REST API, scoped API keys, React Email templates, domain management, and a React admin UI — deploy as a Docker container or to Cloudflare Workers.

Simple by design

One endpoint.
Infinite flexibility.

Send an email with a single HTTP request. Reference a stored template, pass variables, and EmailFlare handles rendering, delivery, and logging.

  • Bearer token auth Scoped API keys — not your master Cloudflare token. Prefix eflive_ for live sends, eftest_ to route through SMTP instead.
  • Template or raw send Pass templateSlug / templateId with variables, or send raw html / text directly. Optional fromName and replyTo fields.
  • Multi-recipient batch "to" accepts a single address or an array of up to 50. Duplicates are deduplicated automatically.
  • Idempotency-Key support Pass an Idempotency-Key header to prevent duplicate sends on network retries — cached result returned on repeat.
  • Rate-limit headers on every response 100 requests/min per key. X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset included.
See full API reference →
POST /v1/send
POST /v1/send
Authorization: Bearer eflive_xxxxxxxxxxxx
Content-Type: application/json
{
  "to": "alex@example.com",
  "from": "hello@yourdomain.com",
  "fromName": "Acme",
  "templateSlug": "welcome",
  "themeId": "ocean",
  "variables": {
    "name": "Alex",
    "loginUrl": "https://acme.com/login"
  }
}
// 200 → { results: [{ to, cfId }] }
Why EmailFlare

Everything Cloudflare Email Sending
should have shipped with.

Cloudflare Email Sending is powerful infrastructure. EmailFlare gives it the API layer, UI, and tooling that makes it ready for production teams.

Scoped keys, not root credentials

Generate per-domain or multi-domain API keys from the dashboard. Your Cloudflare API token never leaves the server — application code only ever sees an EmailFlare key.

Templates you manage, not code you maintain

Store reusable HTML templates with {{variable}} interpolation, plain-text versions, and named React Email layouts. Send by template ID — not inline HTML strings.

Full send history, zero blind spots

Every send is logged — recipient, sender, template used, API key, Cloudflare message ID, status, and error detail. Debug delivery without guessing which email was sent when.

Domain management without the CLI

Provision Cloudflare sending subdomains, inspect DKIM and return-path DNS records, and verify domain status — all from the admin dashboard instead of juggling API calls.

Rate limiting you didn't have to write

Per-key rate limiting is enforced at the API middleware layer. Rogue callers can't flood your Cloudflare quota. Limits and reset times are returned on every response.

One container, not an ops project

Backend, admin UI, and embedded SQLite storage are bundled in one Docker image. No Postgres, no Redis, no separate services to run. Mount one volume and deploy.

Comparison

EmailFlare vs. raw Cloudflare API

Cloudflare Email Sending is solid infrastructure — but a low-level API. EmailFlare is the application layer on top.

Cloudflare Email Sending
Raw API — no application layer
Raw
Complex auth & manual HTTP payload to send
Root CF token exposed in application code
No email templates — build & host yourself
No send logs or delivery visibility
No rate limiting — implement it yourself
No idempotency — duplicate sends on retries
Single recipient only per API call
No admin UI — API calls only
EmailFlare
Application layer built on Cloudflare
Recommended
Simple POST /v1/sendeflive_ or eftest_ prefix
Scoped API keys — per-domain or multi-domain, SHA-256 hashed
50 React Email layouts, 5 themes, variable interpolation
Full send history — status, errors, message IDs
100 req/min rate limiting with X-RateLimit-* headers
Idempotency-Key header — safe retries, no duplicate sends
Multi-recipient batch — up to 50 addresses per call
Full React admin UI — self-hosted, one container
Features

Every primitive you need
for production email.

EmailFlare ships with the full stack of tools for reliable transactional email — not just a thin delivery wrapper.

Domain Management

Add sending domains, provision Cloudflare subdomains, view DKIM and return-path DNS records, and track verification status — no CLI required.

Admin UI

Scoped API Keys

Create keys with global, per-domain, or multi scope. SHA-256 hashed at rest. Only the prefix is shown after creation — the full key is never stored.

Security

Email Templates

Store HTML templates with {{var}} interpolation, optional plain-text fallbacks, and an optional named layout. Send by template ID — skip the inline HTML.

Templates

React Email Layouts

50 production-ready React Email layouts ship out of the box — from Welcome and Magic Link to Invoice, Billing Receipt, Support Ticket Reply, and Incident Update. Switch between 5 built-in color themes per send.

React Email

Send Logs & Stats

Every delivery is logged with recipient, sender, template, API key, Cloudflare message ID, status, and error detail. Dashboard stats give you a live summary.

Observability

Built-in Rate Limiting

Per API-key rate limiting enforced at the middleware layer. Standard X-RateLimit-* response headers on every send request — no extra config.

Reliability

Playground & Preview

Test email sends and preview rendered templates right from the admin UI before they hit a real recipient. Catch rendering issues without burning send quota.

Developer UX

Embedded SQLite Storage

Powered by mesahub-core — embedded SQLite runs inside the container, no external database. Mount a volume at /data and persistence is handled.

Zero Ops

Railway & Docker Ready

Ships with a root railway.json for GitHub-connected Railway deploys, and a published image at ghcr.io/0xdps/emailflare:latest for image-based deploys.

Deploy

Test Keys & Built-in Mailpit

Create a test API key (eftest_) and all sends route through SMTP — no Cloudflare credentials required. Set ENABLE_TEST_MODE=true to start the bundled Mailpit catcher and access it at /mailpit/, secured with HTTP Basic Auth (defaults to root / ADMIN_TOKEN).

Local Dev
React Email Layouts

50 layouts. 5 themes. Ready to send.

Every layout is a React Email component with documented variables. Use them as-is or as a starting point for your own templates. Switch between built-in color themes per send — no CSS edits needed.

Welcome Magic Link OTP Code Email Verify Password Reset Password Changed New Login Alert Notification Order Confirmation Invoice Subscription Started Subscription Cancelled Trial Ending Team Invite Alert Digest Announcement Feedback Request Account Deleted Plain Message Verification Success Subscription Confirmation Payment Failed Renewal Upcoming Subscription Resumed Refund Approved Plan Upgraded Plan Downgraded OAuth Linked Database Created Database Deleted Usage Threshold API Key Created API Key Revoked Plan Limit Reached Email Change Requested Email Change Confirmed Phone Verify Account Locked Account Unlocked Backup Ready Export Ready Import Completed Maintenance Scheduled Incident Update Feature Access Granted Feature Access Revoked Billing Receipt Payment Method Expiring Support Ticket Reply
Self-hosting

Two ways to deploy.

Docker for full control on any server. Cloudflare Workers for zero-ops edge hosting. Both ship in the same repo — pick what fits your stack.

Container
Docker Compose

Self-host on any VPS, server, or cloud VM. One image, one volume, full control. Published to GHCR — no local build needed.

1
Configure environment

Copy the example file and fill in credentials. Add ENABLE_TEST_MODE=true to also start the built-in Mailpit catcher.

cp .env.example .env.local CF_API_TOKEN=your_cf_token CF_ACCOUNT_ID=your_account_id ADMIN_TOKEN=$(openssl rand -hex 32) SESSION_SECRET=$(openssl rand -hex 32) # optional: enable Mailpit ENABLE_TEST_MODE=true
2
Pull & start

Uses the published GHCR image — no local build needed. Mailpit starts automatically when ENABLE_TEST_MODE=true.

# pull the published image docker pull ghcr.io/0xdps/emailflare:latest   # production docker compose --env-file .env.local \   -f compose.yaml up -d   # local dev + mailpit docker compose --env-file .env.local \   -f compose.dev.yaml up
3
Open the dashboard

Admin UI on port 8090. Mailpit at /mailpit/ when test mode is enabled — auth: root / ADMIN_TOKEN.

# health check curl http://localhost:8090/health   http://localhost:8090         # admin UI http://localhost:8090/mailpit/ # if ENABLE_TEST_MODE=true
Serverless
Cloudflare Workers

No servers, no containers, no volumes. D1 database + KV namespace + admin UI all on the edge. One command from clone to live.

1
Clone & install

Requires Node.js, pnpm, and a Wrangler-authenticated Cloudflare account.

git clone https://github.com/0xdps/emailflare cd emailflare && pnpm install npx wrangler login
2
Configure & deploy

Copy the config template, fill in your values, then run setup — creates D1, KV, runs migrations, and deploys.

cp scripts/config.example.toml scripts/config.toml # fill in CF_API_TOKEN, CF_ACCOUNT_ID, ADMIN_TOKEN   just worker-setup # creates D1 + KV, runs migrations, deploys
3
You're live

Admin UI and API are served from your Workers subdomain. No separate hosting.

# your deployment URL https://emailflare.your-subdomain.workers.dev   # custom domain optional via wrangler.jsonc
Architecture

Minimal by design.

EmailFlare is intentionally simple to operate. No orchestration overhead, no extra services, no surprise dependencies.

Your application / HTTP client
Caddy — edge proxy
↓        ↓
Hono API
:3000
React Admin
:80
SQLite
mesahub-core
Cloudflare
Email Sending API
  • No Postgres or Redis SQLite runs embedded via mesahub-core. All data persists in the Docker volume at /data. No external database to provision or back up separately.
  • Three services, one image The production Docker image bundles the Hono API backend, React admin UI, Mailpit, and embedded mesahub storage. Mailpit only starts when ENABLE_TEST_MODE=true — zero overhead in a standard production deploy.
  • Cloudflare Email Sending for production Production API keys send exclusively through Cloudflare's infrastructure. Test API keys route through SMTP for safe testing without CF credentials.
  • Scale out storage when you need to Replace MESAHUB_URL with an external mesahub instance if you ever need to split storage out of the app container.
  • Schema bootstrapped at startup All tables are created with CREATE TABLE IF NOT EXISTS on first boot. No migration framework, no manual schema setup, no CLI commands to run.
Open Source

Built in public. MIT licensed.

EmailFlare is fully open source. Read the code, contribute, file issues, or fork it for your own needs — no strings attached.

Built with Hono · React 19 · React Email · Vite · TanStack Router · Caddy · Cloudflare Email Sending