KWIGA help center LMS (education) Sales and launches (price plans settings, groups, sales outside of Kwiga) Setting up notifications in a Telegram channel

Setting up notifications in a Telegram channel

Articles:

This article outlines the steps to set up receiving notifications about new payments, new registrations, or other events in a Telegram chat.


Notifications in a Telegram channel will help you stay informed, respond quickly, and track customer data.

Step 1: You need to create a Telegram bot. You can use an already created bot or create a new one for this task. You will need the bot’s API token, and you can find out how to create a bot or obtain its token in the article.

Step 2: Create a chat in Telegram (or use an already created one) where the notifications should be sent. Add the bot to this chat (as an administrator). Also, add the bot @myidbot to this chat — it’s necessary to get the chat’s ID.

Step 3: In the chat, type /getgroupid@myidbot (copy this text without editing). You will receive the chat ID in response.



Step 4: Open your project on the Kwiga platform, in the menu select Courses - Process Settings - Process Automation. Create a new trigger and select the event that corresponds to your task.

Examples:

If you want to receive notifications about new registrations (whether the clients paid or not), choose - Contacts - Added.


If you want to receive notifications about new payments, choose - Order - Successful order payment.



In the action, specify the webhook delivery, Method POST.



n the Webhook settings, specify the following parameter:

URL: https://api.telegram.org/bot<token>/sendMessage

Replace <token> with your bot's token. The final URL will look like this (replace the numbers in the example with your bot's token value):

https://api.telegram.org/bot4438664756564457547EabCX4AOtYCu678wOWsib31s/sendMessage

Add the following custom parameters:



chat_id — the chat ID where the notifications should be sent, obtained using the @myidbot bot. If the chat ID is negative, include it as well.
text — the message text that should be sent to the chat when the event occurs. You can use regular text, or HTML/Markdown format. Example message text:

New contact added <a href="https://<insert-your-Kwiga-dashboard-address>/expert/crm/contact/{contact.id}/personal-info">contact #{contact.id}</a> {contact.name}

Or:

Successful payment <a href="https://<insert-your-Kwiga-dashboard-address>/expert/crm/contact/{order.contact_id}/order/{order.id}">order {order.id}</a> for the offer {offer.title} by user {contact.email}

For example, if your dashboard address is sampleschool.kwiga.com, it should look like:
Successful payment <a href="
https://sampleschool.kwiga.com/expert/crm/contact/{order.contact_id}/order/{order.id}">order {order.id}</a> for the offer {offer.title} by user {contact.email}

If you use HTML/Markdown in the text, add parse_mode: html or parse_mode: markdown.
If you add links in the text and don’t want a large preview of the link to appear in the Telegram message, you can add
link_preview_options.is_disabled: true.

Result in the chat:
(Text message according to the template).


Here is the link to the Telegram documentation for sending messages: