Skip to content

Simple CloudFlare Workers to forward emails to Discord webhook

License

Notifications You must be signed in to change notification settings

himax16/cf-email-to-webhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CloudFlare Email to Webhook

Simple CloudFlare Workers to forward emails to Discord webhook.

Usage

  1. Create a CloudFlare Account.

  2. Install CloudFlare Wrangler.

  3. Clone this repository.

  4. Set the worker secrets using npx wrangler secret put <key> or through the CloudFlare dashboard:

    • WEBHOOK_URL: The Discord webhook URL.
    • IN_ADD (optional): The sender email address to accept emails from. If not set, all emails will be accepted.
    • OUT_ADD (optional): The recipient email address to forward emails to. If not set, no emails will be forwarded.
    • PREVIEW_LENGTH (optional): The maximum length of the email preview in the Discord message. Default is 400 characters if not set.

Caution

Make sure that PREVIEW_LENGTH less than the Discord message limit (2000 characters) including the extra line.

  1. Deploy the worker with npx wrangler deploy.
  2. Configure the email rule actions to "Send to a Worker".

About

Simple CloudFlare Workers to forward emails to Discord webhook

Topics

Resources

License

Stars

Watchers

Forks