DEV Community

AndySqlman
AndySqlman

Posted on

Automatically Forward New Emails to Telegram

How to forward different emails to different Telegram groups (or contacts) upon receiving new emails?

SQLTelebot (also known as Telebot) is an SQLMessenger plugin. You can use this plugin to forward emails to Telegram groups or contacts. It can even forward emails as images or PDFs to Telegram.

In addition to forwarding emails to Telegram, this plugin can also forward Telegram messages to email and support bulk messaging.

This article demonstrates how to:

  1. Forward emails (including attachments) sent from [email protected] with the subject containing the keyword "Report1" to the Report1 group.

  2. Forward emails (including attachments) sent from [email protected] with the subject containing the keyword "Report2" to the Report2 group.

Steps:

1. Configure the email account in SQLMessenger to receive emails. Make sure to check the "Allow SQLMessenger to receive emails" option during setup.

Image description

2. Install the SQLTelebot plugin in SQLMessenger.

Image description

3. Create a bot in Telegram. If you already have an existing bot, you can skip this step.

For complete instructions on Telegram bot creation, see: https://core.telegram.org/bots#how-do-i-create-a-bot.

Image description

4. Add the Telegram bot to SQLTelebot.

Image description

5. Add the bot to the Report1 and Report2 groups and assign it as an administrator. Only grant the bot basic admin permissions.

Image description

6. Configure email forwarding rules and enable the "Forward emails to Telegram chat" option in SQLTelebot.

Image description

Once set up, send two test emails—one from [email protected] with the subject containing "Report1" and another from [email protected] with the subject containing "Report2". SQLTelebot will forward these emails (including attachments) to the Report1 and Report2 groups, respectively.

The content of the email
Image description

Messages forwarded to Telegram
Image description

For more details about SQLTelebot, please visit https://www.sqlmessenger.com/manual/plugin-2-index.htm.

Reposted from https://www.sqlmessenger.com/docreader.html?id=578

Top comments (0)