An open source transactional email API built on Cloudflare Workers. Send emails programmatically via a simple REST API — no third-party email provider needed, just your own Cloudflare account.
- Cloudflare Workers Paid Plan — the Email Sending binding requires a paid Workers plan.
- Email Sending onboarding — complete the setup at developers.cloudflare.com/email-service/get-started/send-emails to verify your sending domain and configure the binding.
Install dependencies:
pnpm installRun locally:
pnpm devDeploy to Cloudflare:
pnpm deployAfter deploying, run database migrations:
pnpm db:migrate:remoteCreate the email queues (required for async sending):
wrangler queues create email-send-queue
wrangler queues create email-send-dlqEnqueue a transactional email for async delivery. Returns 202 immediately.
const res = await fetch('https://your-worker.workers.dev/v1/email/send', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-api-key': 'your-api-key' },
body: JSON.stringify({
to: 'recipient@example.com',
from: 'sender@yourdomain.com',
subject: 'Hello',
html: '<p>Hello from Cloudflare Emails!</p>',
// optional: delay delivery up to 12 hours
delaySeconds: 3600,
}),
})
// { id: "uuid", status: "queued" }Poll status with GET /v1/logs/:id.
Fetch the status and details of a single email by its ID.
- Optimizations on top of the email service
- UI polishing
- Better Auth admin + new user invite
- Custom emails using JSX renderer (jsx.email)
- Campaigns: send newsletters and product updates to large audiences
- Contact management: manage contacts with custom fields and full activity history
- Segments: organize contacts with dynamic filtering
- Workflows: automations with triggers, delays, and conditional logic
- Analytics: track opens, clicks, bounces, and engagement metrics in real-time
- Inbound emails: receive and process incoming emails with custom routing rules
PRs and issues are welcome. Open an issue to discuss what you'd like to change.
MIT