Telegram

The Gravity Forms Telegram Add-On sends each matching form submission to a Telegram group, channel, or person through a bot you create.

Overview

The Gravity Forms Telegram Add-On posts a form submission to Telegram. You connect a bot, choose the chat, and write the message. When a submission matches a feed, that message is delivered to the chat.

The bot token is saved under Forms → Settings → Telegram. Detect chats lists the chats the bot can already reach, and you pick one as the default. Each feed can use that default or a different chat.

Messages accept merge tags and can be plain text, HTML, or Markdown. File Upload fields you select are sent with the message: images as photos, and other files as documents. The entry records the chat that received the message.

Key Benefits

  • Choose a chat from the list Telegram has already seen the bot in, or enter a chat ID directly.
  • Send a test message from the Telegram settings page and from each feed.
  • Include uploaded photos and files with the submission.
  • Deliver the feed only when conditional logic matches.

How It Works

In Telegram, create a bot with @BotFather and copy the HTTP API token. Add the bot to the group or channel as an administrator with permission to post messages. To reach a person, that person messages the bot first.

In WordPress, open Forms → Settings → Telegram, enter the bot token, and save. Choose Detect chats, pick the default chat, save, and choose Send test message.

Edit a form and open Settings → Telegram → Add New. Name the feed, keep Chat ID empty to use the default or detect a different chat, choose a message format, and write the message with merge tags. Select the File Upload fields to include, and enable conditional logic when the feed should run only for matching submissions.

When the form is submitted, the add-on sends the message and the selected files. A note on the entry records the chat. If Telegram rejects the message or a file, the error is added to the entry.

Provide feedback here

Requirements

  • WordPress 6.5 or later
  • Gravity Forms 2.9 or later
  • PHP 7.4 or later
  • A Telegram bot token, and a chat the bot can post to

Changelog

0.1.0-alpha.1

  • First alpha release of the Gravity Forms Telegram Add-On.
  • Send a form submission to a Telegram group or channel through a bot.
  • Include uploaded photos and files with the message.
  • View more

Changelog — gravityforms/gravityformstelegram

0.1.0-alpha.1

  • First alpha release of the Gravity Forms Telegram Add-On.
  • Send a form submission to a Telegram group or channel through a bot.
  • Include uploaded photos and files with the message.
  • Format the message as plain text, HTML, or Markdown.
  • Added a test message button on the Telegram settings page and on each feed.
  • Added chat detection, so a chat ID can be chosen from a list instead of looked up by hand.
  • Added guidance to Telegram API errors explaining what to change.
  • Left file fields that are sent as attachments out of the message text.
  • Stopped adding the field label as a caption on uploaded photos and files.

Documentation

Telegram Add-On Documentation


Connect a Telegram bot, create a feed, and send each matching submission to a group or channel.

Connect Telegram

  1. In Telegram, open @BotFather and create a bot. Copy the HTTP API token.
  2. Give the bot access to the chat that should receive messages. For a channel or group, add the bot as an administrator with permission to post messages. For a person, that person has to message the bot first, because a bot cannot start a conversation.
  3. In WordPress, open Forms → Settings → Telegram, enter the bot token, and save. A valid token shows as connected.
  4. Choose Detect chats, then pick the chat to use as the default. Telegram only reports chats the bot has seen in the past 24 hours, so post a message in the chat first if it does not appear. The ID can also be typed in directly.
  5. Save the settings, then choose Send test message. A short message is posted to the default chat when the bot can post there.

Telegram settings with a connected bot token, Detect chats, and Send test message

The Labs notice on this screen is expected. This add-on is not officially supported.

The bot token stays in the plugin settings. The add-on does not ask for a Telegram password.

Create a feed

  1. Edit a form and open Settings → Telegram → Add New.
  2. Name the feed.
  3. Leave Chat ID empty to use the default, or choose Detect chats to send this feed somewhere else.
  4. Choose a message format: plain text, HTML, or Markdown.
  5. Write the message. Merge tags insert entry values. The message is required.
  6. If the form has File Upload fields, choose which files to send with the message. Images are sent as photos. Other files are sent as documents. A selected field is left out of the message, and the file is sent without a caption. A field that is not selected stays in the message as a link.
  7. Optionally enable conditional logic so the feed runs only for matching submissions.
  8. Choose Send test message to post the feed message to this feed’s chat. When Chat ID is empty, the test uses the default chat. Files are not included.

Telegram feed with the message, selected file field, and Send test message

After the form is submitted

When the feed runs, the add-on sends the message to the selected chat. Selected uploads are sent after the message, and those fields are left out of the message text. A note on the entry records the chat that received the message. If Telegram rejects the message or a file, the error is added to the entry.