Send emails to Cloudflare and store them in SQLite (D1).
Setup
Prerequisites
Install dependencies
Setup database
- Setup a D1 database
- Export the environment variables
CF_EMAIL_DB_IDandCF_EMAIL_DB_NAMEwith the database ID and name from previous step.
Deploy the worker
Set up a route
- Go to your zone's Email Workers settings.
- Click the zone (e.g.
example.com), thenEmail,Email Routing. - On the
Email Workerstab, register an email route.
Verify
- Send an email to the email address you registered.
- Check the channel you registered the webhook to.
License
This package is MIT licensed.
