Skip to content

Email Worker that sends you notifications on Telegram once emails are received, Gmail also supported.

License

Notifications You must be signed in to change notification settings

dishapatel010/Email-NotifyTG-Worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email-NotifyTG-Worker

Email Worker that sends you notifications on Telegram once emails are received.

Installation

  1. Fork the repository
  2. Set up the necessary environment variables in wrangler.toml:
    • TOKEN: Telegram bot token (get it from BotFather)
    • database_id: create D1 database emaildb & get it's id here
    • CFURL: https://example.example.workers.dev/ your cf worker url with / trailing
  3. Edit src/index.js email addresses to their corresponding chatIds and forward email ids, and toForward status
      const emailList = [

        { to: "[email protected]", chatId: 5071059420, fMailid: "[email protected]", toForward: false }, //only sends notification as its false

        { to: "[email protected]", chatId: 5071059420, fMailid: "[email protected]", toForward: true }, //sends & forward

        { to: "[email protected]", chatId: 5071059420, fMailid: "[email protected]", toForward: false },

      ];
  1. Set up the necessary environment variables secrets in Settings:
    • CLOUDFLARE_TOKEN: Generate from cloudflare account
  2. Go to D1 emaildb database console & execute
CREATE TABLE CFWTGW (
  id INT PRIMARY KEY,
  html TEXT
);
  1. Run Deploy to Cloudflare Workersaction

Usage

Once the app is running, it will listen for incoming messages on Telegram and automatically forward any received emails to the specified email address. Additionally, it will send a notification message to the specified Telegram chat with a link to the email content on Spacebin.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Screenshot

  • mails on custom domain at cloudflare -215288_temp

  • mails from gmail.com IMG_20230515_210157_926

About

Email Worker that sends you notifications on Telegram once emails are received, Gmail also supported.

Topics

Resources

License

Stars

Watchers

Forks