Skip to content

Lightweight tool to process emails directly from Cloudflare

License

Notifications You must be signed in to change notification settings

NyaMisty/cf-email-worker

 
 

Repository files navigation

Email worker · GitHub license codecov PRs Welcome

Send emails to Cloudflare and forward them to different channels using an email worker.

Setup

Prerequisites

Install dependencies

yarn install

Deploy the worker

wrangler publish

Set up a webhook

  • PUSHURL: your ServerChan URL
  • PUSHCHAN: your send channel (for pushoo-chan only, leave unset or blank for others)
wrangler secret put PUSHURL
wrangler secret put PUSHCHAN

You should see something like this

🌀 Creating the secret for the Worker "email-worker"
✨ Success! Uploaded secret PUSHURL

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.

Tips

  • Change the name field in wrangler.toml to deploy a separate worker with a separate secret (e.g. with a separate webhook for a test channel).

License

This package is MIT licensed.

Sub licenses

About

Lightweight tool to process emails directly from Cloudflare

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.4%
  • JavaScript 1.6%