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 manager1@test.com with the subject containing the keyword "Report1" to the Report1 group.

  2. Forward emails (including attachments) sent from manager2@test.com 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 manager1@test.com with the subject containing "Report1" and another from manager2@test.com 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

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

Tiger Data image

🐯 🚀 Timescale is now TigerData: Building the Modern PostgreSQL for the Analytical and Agentic Era

We’ve quietly evolved from a time-series database into the modern PostgreSQL for today’s and tomorrow’s computing, built for performance, scale, and the agentic future.

So we’re changing our name: from Timescale to TigerData. Not to change who we are, but to reflect who we’ve become. TigerData is bold, fast, and built to power the next era of software.

Read more

👋 Kindness is contagious

Discover fresh viewpoints in this insightful post, supported by our vibrant DEV Community. Every developer’s experience matters—add your thoughts and help us grow together.

A simple “thank you” can uplift the author and spark new discussions—leave yours below!

On DEV, knowledge-sharing connects us and drives innovation. Found this useful? A quick note of appreciation makes a real impact.

Okay