Forwarding New Emails to Telegram Contacts, Groups, or Channels

1 About the Email Forwarding Feature

2 Configuring and Enabling Email Forwarding

3 Priority Settings for Email Forwarding Rules

4 Query Processed Emails

1 About the Email Forwarding Feature

Telebot can help you automatically forward new emails to a specified chat, group, or channel via Telegram Bot when a new email is received.

For example, the following configuration indicates that when an email from "user01@test.com" with the subject containing the keyword "Report" is received at "manager@sqlmessenger.com", the email will be forwarded via the bot "MySalesReport_bot" to the Telegram contact "manager1220".

2 Configuring and Enabling Email Forwarding

Step1: Add email forwarding rules.

In this dialog box:

Apply to Emails Received By

Select which email accounts this rule applies to. Telebot will process incoming emails for these accounts according to this rule.

Keyword in Subject

Enter the keyword for the email subject. The system will apply this rule when the keyword is detected in received email subject.

The format of "Keyword in Subject" adheres to the wildcard syntax of PostgreSQL’s "LIKE" operator (e.g., '%' for any string, '_' for a single character) and is case-insensitive.

For example:

If the keyword is "%abc%" and the email subject contains "abc", it will be classified as this type of email.

If the keyword is "abc%" and the email subject starts with "abc", it will be classified as this type of email.

Visit https://www.sqlmessenger.com/manual/plugin-2-keyword-format.htm for detailed specifications of the keyword format.

Sender Email Addresses

Enter email addresses whose messages should be processed by this rule.

Skip Sender Address Check for Forwarding

After checking this option, "Sender Email Addresses" will become invalid. The system will skip the step of verifying the sender's email address.

Forward Emails via Bot

Select a bot, and the system will forward emails that meet this rule to the designated chat or group via this bot.

Forward Emails to Chat

Select a chat or a group. The system will forward emails that meet this rule to this selected chat or group.

Note: If you cannot find the recipient contact/group or channel in the list, click here for solutions.

Forward Selected Parts of the Email

Select which parts of the emails you want to forward to Telegram. You can choose from the following options:

Email header (includes subject): Forward the sender, subject, and timestamp to Telegram.

Email body: The email contents can be converted to plain text, PNG image, or PDF file and forward to Telegram.

Attachments: Forward the email's attachments to Telegram.

Convert Email Body to

Select the conversion method for the body of the emails. Telebot can convert the body of the emails into plain text, PNG images, or PDF files and forward them to Telegram. By default, they are converted to plain text.

Step2: Turn on the "Forward emails to Telegram chat" switch.

Step3: Configure the "Allow SQLMessenger to receive emails" option for the email account.

Click here to learn more about the detailed configuration of the email account.

3 Priority Settings for Email Forwarding Rules

When Telebot evaluates email forwarding rules, it determines which rule to apply based on the priority of the rules.

For example, consider the following configuration:

When an email with the subject "Report(0520)-by Andy" is received, both rules match the conditions. In this case, the system will apply the rule with the higher priority, which is Rule 10017.

If you want the second rule to be applied instead, you can adjust the priority settings as follows:

Step 1: Click the "Priority Setting" button.

Step 2: Select the rule to adjust, then click "Move Up" or "Move Down" to position the rule correctly, and then click "OK."

After adjusting the priority settings, they will appear as follows:

When processing emails again, the system will apply Rule 10018 to forward the email.

4 Query Processed Emails

You can query the list of processed emails in the "Email Manager" and also reprocess the emails according to the current email forwarding rule configuration.