Email Handler
English | Indonesian
A serverless Cloudflare Email Worker that parses incoming emails, stores them in D1, and posts a human-readable .txt summary to Discord via webhook.
How It Works
On each incoming email:
- Worker parses MIME and extracts metadata (from, to, subject, date, body).
- Stores email to D1 storage.
- Create a summary
email.txtlike the example below and send it to Discord Webhook.
๐ค From : sender@example.com ๐ฅ To : you@domain.com ๐ Key : ab12cd34 ๐ Date : 4/24/2025, 3:15:07 PM ๐งพ Subject : Hello World ๐ Links : - https://example.com ๐ Message : This is the email bodyโฆ
Configuration
.vars
| Environment Variable | Description |
|---|---|
DISCORD_WEBHOOK_URL |
Discord webhook URL |
DASHBOARD_USER |
Dashboard username |
DASHBOARD_PASS |
Dashboard password |
wrangler.jsonc
