Skip to main content
Telegram is a cloud-based instant messaging application designed for fast, secure, and cross-device communication. Telegram helps brands to:
  • Deliver rich interactive push alerts with custom media and redirect pathways.
  • Automate real-time customer support alerts and transaction reports.
  • Directly reach targeted groups, subscriber lists, or public channels.

MoEngage <> Telegram

The MoEngage and Telegram integration uses MoEngage Connectors to link your campaigns with the Telegram Bot API. By connecting your bot, you can utilize MoEngage segmentation, dynamic personalization, and behavioral triggers to send tailored messages directly to Telegram users or public channels.

Pre-Built Connectors

MoEngage provides pre-built connectors to support your various messaging requirements:
ConnectorDescription
Send a message to a user or a channelSends text messages with support for MarkdownV2, HTML, and Markdown formatting.
Send Photo MessageSends a photo with captions and inline Call-to-Action (CTA) buttons.
Send Photos & VideosSends a media group with captions.

Integration

Prerequisites
  • Telegram Bot: You must create a Telegram bot. Your messages use this bot’s identity, meaning users see your bot details as the sender. Set up your bot using the official Telegram Bot Creation Tutorial.
  • Bot Token: The unique authorization token you obtain when creating your bot via BotFather to authorize API requests.
  • Telegram Chat IDs: The unique destination identifiers required to route messages. These are distinct from public usernames.
To deliver personalized campaigns, you must populate the recipient’s identifier (Telegram Chat ID) as a user attribute inside MoEngage.
Telegram rules allow you to send promotional and transactional messages to users who have given consent. To receive your bot’s messages, users must meet one of the following conditions:
  • Users have started a conversation with your Telegram bot.
  • Users have sent a message to your Telegram bot (and have not blocked the bot since).

Step 1: Collect Your Users’ Telegram Chat IDs

To send messages via Telegram, you must collect your users’ unique Telegram Chat IDs to identify and interact with them. Chat IDs are numeric values generated by Telegram and differ from user handles. After a user interacts with your bot, you can capture their Chat ID through the Telegram getUpdates API.

Step 2: Save the User’s Telegram Chat ID on MoEngage

After you capture the Chat IDs, save them in MoEngage as a custom-tracked user attribute named telegram_chat_id. Write this attribute using either of the following methods:

Step 3: Integrate Telegram with MoEngage

To set up your Telegram connectors inside MoEngage, perform the following steps:
  1. On the MoEngage Dashboard navigation bar, click App marketplace.
  2. Search for Telegram and select the Telegram tile.
  3. On the Telegram page, go to the Integrate tab.
  4. Click the + Add integration down-arrow key and then click your preferred connector type from the drop-down list. Telegram Add integration drop-down list
  5. Enter the following details:
    FieldDescription
    Connection nameThe unique internal name for your connection.
    Bot TokenThe unique authorization credentials provided by BotFather during creation.
  6. Click Connect. Telegram connection Connect button

Step 4: Create a Campaign on MoEngage to Send a Telegram Message

To launch a Telegram campaign, perform the following steps:
  1. Navigate to Engage > Campaigns and click + Create campaign.
  2. In the campaign setup dialog, click Telegram under Connected Apps, and select your preferred delivery type.
  3. Under Select audience, click Filter users by. Under the User property tab, define a segment where the telegram_chat_id attribute exists.
  4. In Step 3 of the campaign creator, select your connector and define your parameters.
Based on the connector you select, you must provide the following details:
Use this connector to transmit a plain-text message. You can utilize MarkdownV2, HTML, or traditional Markdown formatting systems.
FieldRequiredDescription
Chat IDYesThe recipient’s Chat ID. Supports personalization tags like {{UserAttribute['telegram_chat_id']}}.
Message ContentYesThe text of your message (maximum 4096 characters). Personalization is supported.
Formatting Style (Parse Mode)YesDetermines text styling parsing. Choose HTML, MarkdownV2, or Markdown.
  1. Your campaign is now ready to be tested and sent to your audience. Use the Test functionality to dispatch a sample payload to a test user chat ID and verify your configuration.
  2. Publish the campaign. Telegram campaign publish

Send a Telegram Message to a Channel or Group

To deliver campaigns to your public Telegram channel or a restricted group chat, perform the following steps:
  1. Create a virtual user record in MoEngage to represent the channel or group. Set the telegram_chat_id attribute of this user profile to your target group ID or public channel ID (for example, -100123456789 or @mychannel). Learn how to acquire these IDs through this detailed Chat ID retrieval guide.
  2. Isolate this single user profile by creating a specific segment. Ensure your target segment contains exactly one user. If you target multiple users with the same channel ID, MoEngage sends duplicate messages to the channel for each matched profile.
  3. In Step 2 of the campaign creator, define the target Telegram Chat ID using the channel or group credentials.
Use the matrix below to choose the correct connector based on your message payload:
Messaging NeedTarget ConnectorInteractive CTA Buttons Supported?
Only text contentSend a message to a user or a channelNo
Single photo with optional caption and redirect linksSend Photo MessageYes (Up to 8 inline buttons)
Media bundle (mix of up to 10 photos or videos) with a single captionSend Photos & VideosNo (Telegram APIs restrict inline buttons on media groups)

Campaign Analytics

MoEngage tracks messaging attempts and API responses to calculate performance analytics. By default, MoEngage tracks the following metrics for your Telegram campaigns:
  1. Attempted: The number of users who qualified for your campaign after applying frequency capping (FC) limits and for whom MoEngage initiated message dispatch. Refer to the MoEngage Connected Apps Campaign Analytics guide for complete details.
  2. Failed: The number of instances where the Telegram API rejected the payload, or cases where MoEngage could not resolve personalized attributes used in your content.
  3. Successfully Sent: The number of messages accepted by Telegram servers. MoEngage increments this metric when Telegram APIs return an HTTP status code 200.