Blog

How to send HTML form submissions to Telegram

Send website form submissions to a Telegram chat with SiteBackend. Connect a bot, choose a chat, and test notifications without writing server code.

Yash··3 min readTutorialsContact FormsTelegram

To send HTML form submissions to Telegram, post your website's form to SiteBackend and add a Telegram notification channel. Connect your bot, select the destination chat, and SiteBackend sends new submissions there. The bot token stays in the dashboard rather than your public website code.

This setup works with plain HTML and doesn't require a bot server of your own. SiteBackend receives and stores the message before sending the notification.

1. Connect your website's form

Create an account, click Add site, and create a New form inside it. Copy the endpoint from the form's page and replace the example URL below with yours.

contact.html
<form action="https://api.sitebackend.com/forms/YOUR_FORM_ID" method="POST">
  <label>
    Name
    <input type="text" name="name" autocomplete="name" required />
  </label>
  <label>
    Email
    <input type="email" name="email" autocomplete="email" required />
  </label>
  <label>
    Message
    <textarea name="message" rows="6" required></textarea>
  </label>
  <input type="text" name="_gotcha" tabindex="-1" autocomplete="off" style="display:none" />
  <button type="submit">Send message</button>
</form>

Every submitted field needs a name. Keep the hidden _gotcha field empty so it can help detect spam. See the static website contact form guide for a fuller walkthrough.

2. Create a Telegram bot

Open @BotFather in Telegram, send /newbot, and follow its instructions. Copy the bot token it gives you. Telegram's official bot tutorial explains this registration process.

Enter the token only in SiteBackend's Telegram channel settings. Your HTML form uses the public SiteBackend endpoint; it doesn't need the bot token.

3. Pick the destination chat

Open Form → Notifications → Add channel and choose Telegram. Paste the token into Bot token and click Connect.

For a direct message, follow the dashboard's link to your bot and send it a message, such as “hi”. Return to SiteBackend and select that chat under Send to.

For a group, add the bot to the group and send a command addressed to the bot there. Then select the group when it appears. For a channel, add the bot as an administrator with permission to post and publish a channel message before checking the destination list.

The dashboard looks for recent chats and also lets you enter a chat ID manually. Choose the intended destination, save the notification channel, and check that its test message arrives. Keep the channel enabled.

4. Test a submission from your live website

Publish the form and send a recognizable test message. Confirm that it appears in the SiteBackend form's inbox and in the selected Telegram chat.

The Telegram notification includes submission fields and a link to open the message in SiteBackend. Long notification text is shortened, so use the dashboard to inspect the full submission.

A channel test checks the bot and destination. Submitting from the website also checks your endpoint, field names and form settings.

What if the chat doesn't appear?

SymptomWhat to check
The token isn't recognizedCopy the current token from BotFather and connect again.
No direct chat appearsOpen the bot and send it a fresh message, then reconnect.
A group is missingConfirm the bot is a member and send it an addressed command in the group.
The bot already has a Telegram webhookEnter the chat ID manually; SiteBackend's chat lookup can't list updates while that webhook is set.
A saved channel can't deliverCheck the delivery log and whether the bot can still post to the destination.

If an existing bot serves another application, a separate bot for form notifications avoids sharing its setup.

Which submissions trigger notifications?

Notifications are configured per form. Spam doesn't trigger them, and Free-plan submissions beyond the monthly limit are saved but hidden and don't send notifications. See plans and limits.

For failed deliveries, use the log and retry controls in Form → Notifications. The notifications guide explains delivery status and automatic retries.