WordPress Telegram Bot - Use Case - How to Automatically Store Files from a Telegram Group or Channel in WordPress and Send via Email


Use Case - How to Automatically Store Files from a Telegram Group or Channel in WordPress and Send via Email

Back to User Guides

Note: This guide requires:

Introduction

WordPress Telegram Bot is a WordPress plugin that allows you to send automatic messages, emails and SMS based on Telegram conversations and much more. You can use the WordPress Telegram Bot plugin to automate business workflows involving the messenger app.

Main functionalities:

  • Email Repeater - Send messages sent on a Telegram group to one or many emails. Mark words as “stop words” to prevent them from triggering the bot.
  • Personal Messages - Mention a user after certain words or expressions are sent to the group together with a message to this user.
  • Group Messages - Emit message to all users based on certain conditions in a specific group.
  • SMS Repeater - Send a copy of Telegram group conversations to a mobile device.
  • SMS Alerts - Send notifications to multiple phone devices whenever certain keywords are used.
  • WordPress Repeater - Store all messages from a specific group or several groups in WordPress and output the content using a shortcode.
  • Storing Files - Copy files that were posted in groups or channels to your WordPress site storage.

Use Case Front-End

Links to stored files in the back-end log:

Links to stored files in the back-end log - WordPress Telegram Plugin
Links to stored files in the back-end log

Links to stored files in the front-end log:

Links to stored files in the front-end log - Telegram WordPress Widget
Links to stored files in the front-end log

Sending links to files via email:

Sending links to files via email - Telegram Plugin for WordPress
Sending links to files via email

Use Case Assumptions

In this example we will consider how to store files posted in Telegram groups and channels, and how to send links to files stored from groups via email.

Requirements

  • The WordPress Telegram Bot plugin will only work on sites with installed SLL certificates (HTTPS).
  • You cannot use the same access token (bot API) on different sites.
  • The bot may not perform properly with supergroups.

It follows:

Installing the Plugin

The process is the same for all CM plugins and add-ons.

CreativeMinds Customer Account Dashboard - Downloads tab
CreativeMinds Customer Account Dashboard
  • Download the plugin from your customer dashboard.
  • Log in to WordPress and navigate to the WordPress Admin → Plugins settings.
  • Click on Add New.
  • Activate it and add the license.

Learn more: Getting Started - Plugin Overview


Enabling the File Storage Feature

First, navigate to Admin Dashboard → CM Telegram Bot → Settings → General Settings tab.

Navigation to general plugin settings - Telegram Group Bot Manager
Navigation to general plugin settings

Scroll down and find the section Storing Files Settings. There you need to configure the following settings:

Storing files settings - Telegram Group Bot Manager
Storing files settings
  • Enable storing files - Turn on this option.
  • Where to store files - Define the folder where the files should be saved. It will be created at the following path: /wp-content/uploads/
  • Supported file extensions - Define the list of file types you want to store. Separate them with a comma.

Then click the button Save.

Once it's done, the supported file extensions posted in your Telegram groups or channels will be automatically saved to your WordPress site storage.

Now let's post a couple of messages with attached files.

We will post 1 file in the Telegram group:

Posting a file to the Telegram group - WordPress Telegram Plugin
Posting a file to the Telegram group

And 3 files in the Telegram channel:

Posting multiple files to the Telegram channel - Telegram WordPress Widget
Posting multiple files to the Telegram channel

And then check where you can view these files.

Log of Stored Files

Navigate to Admin Dashboard → CM Telegram Bot → Log.

Navigation to the back-end log - Telegram Plugin for WordPress
Navigation to the back-end log

Here you can check the log of all messages posted in your Telegram groups and channels. Once some file or multiple files are posted in one of the groups, they will be shown in the log in the column Message. Each file has links to View or Download it.

Back-end log - Telegram Group Bot Manager
Back-end log

And in the column Action you can see the source of the message.

Stored Files In WordPress Repeater Log

It works similarly with WordPress Repeater.

WordPress Repeater allows you to display the same log on the front-end. You can display either the whole log or only certain message categories. Learn more.

Once files are posted in a Telegram group or channel, users will be able to see them in the log on the front-end:

Front-end log example - Telegram Bot Plugin for WordPress
Front-end log example

The plugin also allows you to send links to stored from a Telegram group files to the specified email address.

To configure it, navigate to the Admin Dashboard → CM Telegram Bot → Settings → Email Repeater tab.

Navigation to email repeater settings - WordPress Telegram Plugin
Navigation to email repeater settings

Here you can create and edit rules for replicating messages from Telegram groups to email. For each rule you can define the email template.

Learn more about setting up rules for Email Repeater.

To send file links in the email, you need to add a placeholder {file} to the email template, then save the settings:

Placeholder for adding files links to email - Telegram WordPress Widget
Placeholder for adding files links to email

Once it's done, each message posted in the specified group will be replicated to the email.

Let's post a message in a Telegram group with multiple files:

Posting files to the Telegram group - Telegram Plugin for WordPress
Posting files to the Telegram group

And here's an email example:

Email example - Telegram Group Bot Manager
Email example

In the log, you can also see a record about if the email was sent successfully:

Record about sent email in the back-end log - Telegram Bot Plugin for WordPress
Record about sent email in the back-end log

End Result

Following instructions found in the plugin and guides, you should be able to store files posted in Telegram groups and channels, and to send links to files stored from groups via email.

Use Case Front-End

Links to stored files in the back-end log:

Links to stored files in the back-end log - WordPress Telegram Plugin
Links to stored files in the back-end log

Links to stored files in the front-end log:

Links to stored files in the front-end log - Telegram WordPress Widget
Links to stored files in the front-end log

Sending links to files via email:

Sending links to files via email - Telegram Plugin for WordPress
Sending links to files via email

More information about the WordPress Telegram Bot plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.