GitHub - hbmartin/cloudflare-email-worker-sqlite: Lightweight tool to process emails directly from Cloudflare

GitHub license Checked with Biome Lint and Test

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_ID and CF_EMAIL_DB_NAME with 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), then Email, Email Routing.
  • On the Email Workers tab, register an email route.

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.