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 — all shipped in a single Docker container.

bash
# 1. Configure credentials
$ cp .env.example .env.local
# 2. Start the stack
$ docker compose --env-file .env.local -f compose.yaml up -d
Container emailflare-backend Started
Container emailflare-admin Started
Dashboard → http://localhost:8090
1 Docker container
0 Extra databases
20 Email layouts
100% Cloudflare-powered delivery
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. Rotate or revoke with a click.
  • Template + raw send Reference a stored template by ID, or pass subject and html directly.
  • Rate-limit headers included X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset on every response.
POST /v1/send
POST /v1/send
Authorization: Bearer emailflare_xxxxxxxxxxxx
Content-Type: application/json
{
  "to": "alex@example.com",
  "from": "hello@yourdomain.com",
  "template": "welcome",
  "variables": {
    "name": "Alex",
    "appName": "Acme",
    "loginUrl": "https://acme.com/login"
  }
}
// 200 → { "ok": true, "messageId": "cf_msg_..." }
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 excellent infrastructure — but it's a low-level API. EmailFlare is the application layer that makes it production-ready.

Capability Direct Cloudflare API EmailFlare
Send emails over HTTP Complex auth, manual payload Simple POST /v1/send
API key management Use root CF token in code Scoped keys, per-domain
Email templates Build and host yourself 20 layouts, variable interpolation
Send logs No delivery visibility Full history with status & errors
Domain setup UI Cloudflare dashboard only Dedicated domain manager
DNS record inspection CF dashboard or API only In-app DNS record view
Rate limiting Implement it yourself Per-key, headers included
Email preview & playground Not available In-dashboard test & preview
Admin dashboard Cloudflare dashboard only Dedicated React admin UI
Self-hosted on your infra Vendor-managed only One container, your server
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

20 production-ready React Email layouts ship out of the box — from Welcome and Magic Link to Invoice, Order Confirm, Trial Ending, and Team Invite.

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 & SMTP Routing

Create a test API key in the admin UI and all sends route through SMTP instead of Cloudflare — no CF credentials required. Point SMTP_HOST/SMTP_PORT at any catcher (Mailpit, Mailtrap, etc.). The dev compose stack bundles Mailpit automatically.

Local Dev
React Email Layouts

20 layouts. 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.

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
Self-hosting

Deploy in three steps.

EmailFlare ships two compose stacks — compose.yaml for production and compose.dev.yaml for local development — with Mailpit included so emails never hit real inboxes during testing.

01
Configure your environment

Copy the example env file and fill in your Cloudflare credentials, admin token, and session secret. The MESAHUB_URL setting controls where data is stored — the default keeps everything local.

cp .env.example .env.local   # Minimum required variables ADMIN_TOKEN=$(openssl rand -hex 32) SESSION_SECRET=$(openssl rand -hex 32) MESAHUB_URL=mh://local/emailflare CF_API_TOKEN=your_cloudflare_token CF_ACCOUNT_ID=your_account_id
02
Start the stack

Bring up the production compose stack. The image is published to GHCR — no local build required. Or use just prod if you have Just installed.

# Production docker compose --env-file .env.local -f compose.yaml up -d   # Local dev (includes Mailpit — no real emails sent) docker compose --env-file .env.local -f compose.dev.yaml up
03
Open the dashboard

Verify the health endpoint, open the admin UI, add your first domain, and generate an API key. Mailpit is included for safe email testing in dev.

# Verify the service is up curl http://localhost:8090/health   # Admin dashboard http://localhost:8090   # Mailpit (dev email testing) http://localhost:8090/mailpit/

🧪 Test without touching real inboxes — anywhere

EmailFlare has first-class test mode: test API keys route sends through SMTP instead of the Cloudflare Email Sending API — no CF credentials required. Point SMTP_HOST and SMTP_PORT at any SMTP catcher (Mailpit, Mailtrap, etc.) — this works on Railway, Docker, or any other deployment. For local dev, compose.dev.yaml bundles Mailpit automatically; the UI is accessible at http://localhost:8090/mailpit/.

Mailpit docs →

Prefer one-click Railway deploys?

The repo ships with a pre-configured railway.json. Create a new Railway project from the GitHub repository, add the required environment variables, attach a volume at /data, and deploy. Or use the published image ghcr.io/0xdps/emailflare:latest on any platform.

Railway guide →
🔐
Cloudflare API Token guide
Exact permissions, step-by-step — takes 3 minutes.
☁️
Skip volume management with mesahub
One-line switch to cloud-hosted SQLite storage.
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, and embedded mesahub storage — nothing else. Mailpit is a separate dev-only container in compose.dev.yaml.
  • Cloudflare Email Sending for production Production API keys send exclusively through Cloudflare's infrastructure — no AWS SES, no third-party relay. 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