Channels
Products
Transactional SMS-messaging
Support and marketing in most popular messaging apps
Instagram
Telegram
Messenger
Use Cases
Omnichannel messaging
FAQ Bots
Live support

How to link telegram_id to a phone number?

Telegram bot welcome script
The script checks if the client’s phone number is known (if the phone and telegram_id are linked). If the phone is known, the bot sends a welcome message, and for any reply message from the client, the bot notifies the business of the message via email.
Go to the "Scripts" section in the Fromni —> "My scripts" list and press "Create a script".
Write the bot name in the opened window and, if necessary, write a description.
Do NOT tick the box next to "Campaign script". Press "Next".
The script creation window will open.
Here, you need to set up the bot script consisting of the following blocks: "Condition", "Ask a question", "Digital Profile", "Message", "Reply", "Notification".
Arrange the blocks as shown in the screenshot below and connect them.
Condition.
In this block, we check if the phone number is connected to the telegram id.
This block must be the first one in the script, i.e. marked with the Start tag.
Press the gear icon in the top right corner of the block and write #$contact.phone# in the "If" field in the block settings. After that, press "Save" at the top right corner.
Ask a question.
This block will ask the client for their phone number. Also press the gear icon in the top right corner of the block and fill in the text fields, and select "Phone number" in the "Expected response type" field. In the "Save reply in a variable" field enter phonenumber. Then press "Save" at the bottom right corner.
Digital profile.
Follow the same steps as in the previous blocks. Block settings are in the screenshot.
Message.
We have two "Message" blocks. In both of them, you need to write a text that the bot will send to the client in the "Bot says" field.

In the example, the first block contains the following text: "Hi. This is a telegram bot. I will connect you to the managers of Fromni company", and the second block contains the following text: "A manager will contact you soon".

In other words, the first message is sent to the client after they provide their phone number or immediately after subscribing to the bot (if the phone is already linked to the telegram id), and the second message is sent if the client sends a reply to the first message.
Reply.
This block is used to receive the client’s reply and save it.
Notification.
This block allows the bot to send a message to the business’s email.
After you have set up all the blocks, check that the initial condition is marked with the Start tag and press "Save" at the top right corner.
Then go to the "Integrations" section.
Select the required telegram bot in the opened window.
Then go to the "Settings" section.
Write /start in the "Commands to activate the script" line in the opened window.

And tick the box next to Telegram (set this script as the default script). Then press "Save".
The script is ready. You can open the bot from the phone number that you haven’t logged in from before and check all the script steps.
Need more help?
Write us email to support@fromni.com
Did this answer your question?
Customers support, engagement and marketing through multiple channels including WhatsApp, Instagram and SMS.
Transactional messaging. Deliver SMS-messages around the world on a platform trusted by 2000+ customers.
Fromni. Chatbots
Fromni. SMS-gateway
Customers support, engagement and marketing through multiple channels including WhatsApp, Instagram and SMS.
Transactional messaging. Deliver SMS-messages around the world on a platform trusted by 2000+ customers.
Fromni. Chatbots
Fromni. SMS-gateway