In this post, we will learn how you can integrate Telegram with WhatsApp. After successfully integrating the two platforms, any message received on Telegram will be automatically forwarded to WhatsApp via the WhatsApp Cloud API.
This automation requires a one-time setup, for which we will use Pabbly Connect.
The first step involves linking Telegram with Pabbly Connect to capture messages. Next, we will connect Pabbly Connect with Google Sheets to save the captured messages and finally share the messages on WhatsApp.
Step to Auto-Forward Telegram Messages to WhatsApp
1. Sign In / Sign Up to Pabbly Connect and Create a Workflow
2. Establish a Connection between Telegram and Pabbly Connect
3. Setup Google Sheets as the Action App to Capture Contacts
4. Add an Iterator to the Workflow
5. Setup WhatsApp Cloud API as the Action App to Send Messages
6. Compose a Message Template
7. Map the Necessary Fields
Step 1:- Sign In / Sign Up to Pabbly Connect and Create a Workflow
A. Sign In / Sign Up
To begin this process, visit Pabbly Connect and create your account by clicking on the ‘Sign Up Free’ button. You can also click on Sign In if you already have an account.
Click on the Pabbly Connect ‘Access Now’ button
B. Create Workflow
To create a new workflow, click the ‘Create Workflow’ button.
Name your workflow, and click on ‘Create’.
Step 2:- Establish a Connection between Telegram and Pabbly Connect
We will now look at the steps through which we will establish a link between Telegram and Pabbly Connect – this will help us capture the messages from Telegram.
Trigger allows us to designate the application that will obtain data for Pabbly Connect. In our case, it would be Telegram.
A. Trigger App
Choose ‘Telegram’ as the Trigger App, select ‘Set Webhooks / Watch Updates’ as an Action Event, and click on ‘Connect’.
B. Connect Telegram Account
To connect with your Telegram account, select ‘Add New Connection’. You will be asked to enter your Token. Go to ‘https://telegram.me/BotFather’ and click on ‘Send Message’.
C. Create a New Bot
To capture files from Telegram, you are required to have a bot. Type ‘/newbot’ and send the message.
When prompted, provide a Name and Username for your newly created bot.
Copy the API Token, paste it into its given field, and click on ‘Save’.
Now, click on ‘Save & Send Test Request’.
Give your Bot access to the messages, and add it to the group from which you intend to collect messages. Also, send a new message for testing.
We have established a link between Telegram and Pabbly Connect. Pabbly Connect will now automatically capture the messages from Telegram.
Step 3:- Setup Google Sheets as the Action App to Capture Contacts
Action allows us to choose the application that will get executed by the workflow trigger.
In order to forward messages on WhatsApp, it is necessary to first obtain the contact numbers of the recipients to whom the messages will be sent. To obtain the contacts, we will set up Google Sheets as the Action App.
A. Action App
Choose ‘Google Sheets’ as the Action App, select ‘Get Row(s)’ as an Action Event, and click on ‘Connect’.
B. Connect Google Sheets Account
To connect with your Google Sheets account, select ‘Add New Connection’, and click on ‘Connect With Google Sheets’. Also, grant the authorization.
Select the Spreadsheet and Sheet from where you want to capture the contacts.
Enter the Range for your data, toggle off Simple Response, and click on ‘Save & Send Test Request’.
Expand Response Received under which the contact details must be visible.
Step 4:- Add an Iterator to the Workflow
The contact details obtained from Google Sheets are currently grouped together in a disorganized manner. To arrange the contact details into rows, we will use Iterator by Pabbly.
Choose ‘Iterator by Pabbly’ as the Action App, and click on ‘Save & Send Test Request’.
The data is now arranged in proper row format and can be utilized to send messages.
Step 5:- Setup WhatsApp Cloud API as the Action App to Send Messages
After acquiring the contact information from Google Sheets, our objective is to send WhatsApp messages.
Therefore, WhatsApp Cloud API will be our Action App.
Note: Follow steps 1 to 3 of this blog to create a new Whatsapp Business Cloud API account if you don’t already have one.
A. Action App
Choose ‘WhatsApp Cloud API’ as your Action App, select ‘Send Template Message’ as an Action Event, and click on ‘Connect’.
B. Connect WhatsApp Cloud API Account
To connect with your WhatsApp Cloud API account, select ‘Add New Connection’. You will be prompted to enter your Permanent Token, Phone Number ID, and WhatsApp Business Account ID.
Go to your Facebook Developer dashboard, and copy the Phone Number ID and WhatsApp Business Account ID.
Paste both in their respective fields.
The Token visible on your dashboard is a temporary one that expires every 24 hours. For our workflow, we need a Permanent Token. You can generate a Permanent Access Token by following the steps given in this post.
Paste the Permanent Token, and click on ‘Save’.
Step 6:- Compose a Message Template
You will be prompted to complete several fields. If you already have a prepared Template Name, you may choose it directly from the list, or if necessary, you may create a new message template by following these steps.
A. Create a Message Template
Switch to your WhatsApp Cloud API dashboard, and click the ‘here’ hyperlink. You will be redirected to a new page.
Click on ‘Create Message Template’.
Select a Category, Name the template, and pick a Language. Click on ‘Continue’.
B. Body with Dynamic Data Tags
Enter your message into the Body field. To personalize your message, incorporate Dynamic Data Tags within your template.
Dynamic Data Tags facilitate the inclusion of variables within our template, which will be substituted with actual data in your message. The actual data can be a name, an email address, date, time, ID number, etc. To add a dynamic tag to your template, write your variables between double curly braces {{variable}}.
‘Submit’ your message and ‘Confirm’.
Upon submitting your template, it may be approved immediately or be subject to a manual review by Facebook, a process that could take anywhere from a few minutes to several hours. Refresh your page periodically to determine if your template has been approved and is accessible, as denoted by the green color.
Step 7:- Map the Necessary Fields
Now that you have connected your WhatsApp account, all you need is to map the necessary details from the steps above. Mapping ensures our data remains dynamic and changes as per the received responses.
Select your Template Name.
Map the Recipient Mobile Number from the step above.
Remember the Dynamic Data Tags we talked about? Those tags will be replaced by the data present in Body Fields.
In Body Fields, enter or map the relevant data from above. This could vary as per your choice of variable. Click on ‘Save & Send Test Request’.
As soon as you click on Save & Send Request, a WhatsApp message will be sent to the recipient’s mobile number.
We have finished the automation process and effectively combined Telegram and WhatsApp. This means that any message you receive in your Telegram group will be automatically forwarded to WhatsApp.
You can copy this entire workflow by clicking this link.
Sign Up for a free Pabbly Connect account, and start automating your business
Subscribe to our Youtube Channel for more such automation
For any other queries, visit our forum