Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 1.11 KB

README.md

File metadata and controls

21 lines (15 loc) · 1.11 KB

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".