Integrations
Published: 27-Jul-2026

How to Send HTML Form Data to Telegram

Get Telegram messages for every new lead from your HTML form. Wire a form endpoint to Telegram notifications without writing bots from scratch or hosting webhooks yourself.

MFC

MyFormConnect Team

Telegram is a useful notification channel for small teams and solo developers — the mobile app is fast, notifications are reliable, and you don't need a separate account on a paid service. This guide shows how to get a Telegram message for each new form submission without exposing your bot token in the browser.

Why you can't put the bot token in your page

The Telegram Bot API requires a bot token to authenticate requests. If you call the API directly from JavaScript in the browser, that token is visible in the page source and browser network tab. Anyone can use it to send arbitrary messages to your bot or scrape your chat history.

Bot tokens must stay server-side. That's either your own backend, or — for forms without a backend — the integration layer of a form service.

How the safe pattern works

Your HTML form posts to a form endpoint. The endpoint — which runs on a server you don't manage — holds the bot token and calls the Telegram Bot API on your behalf after storing the submission. Your page never sees the token.

Step 1: Create a Telegram bot

  1. Open Telegram and search for @BotFather
  2. Send the command /newbot
  3. Choose a name and username for the bot (the username must end in bot)
  4. BotFather will reply with a token — copy it, you'll need it in the next step

Decide where Telegram messages should arrive: a private chat with the bot, a group, or a channel. To get your chat or channel ID, forward a message from it to @userinfobot.

Step 2: Connect Telegram in the form settings

  1. Create a form in MyFormCapture
  2. Go to Integrations → Telegram
  3. Enter your bot token and chat ID
  4. Optionally customise the message format
  5. Save and copy the form endpoint URL

Step 3: Add the form to your page

<form action="https://myformconnect.io/f/YOUR_FORM_ID" method="POST">

  <label for="name">Name</label>
  <input id="name" name="name" type="text" required />

  <label for="email">Email address</label>
  <input id="email" name="email" type="email" required />

  <label for="message">Message</label>
  <textarea id="message" name="message" rows="5" required></textarea>

  <!-- Helps you see which page generated the lead -->
  <input type="hidden" name="page_source" value="Contact page" />

  <input type="hidden" name="_redirect" value="https://yoursite.com/thank-you" />

  <button type="submit">Send message</button>

</form>

What the Telegram message looks like

Each new submission triggers a Telegram message containing the submitted field values. A typical message looks like:

📬 New form submission

Name: Sarah Müller
Email: [email protected]
Message: I'd like a quote for 10 licences.
Page: Contact page
Received: 27 Jul 2026, 14:32

You can customise which fields appear and the message format in your form settings.

Using Telegram with multiple forms

You can connect different forms to different Telegram chats or groups. A lead form on the pricing page could go to a sales group; a support form could go to a support group. The page_source hidden field also helps distinguish messages if everything lands in one chat.

A practical notification setup

Telegram works well as a secondary notification channel alongside email — email for a reliable record, Telegram for an immediate alert on your phone. Because the bot token stays server-side inside the form endpoint, there's nothing sensitive in your page source, and rotating the token if needed is a dashboard change rather than a code deployment.

Once the connection is set up, new form submissions arrive in Telegram automatically without any further configuration changes on your end.

Ready to collect form submissions?

Create a free MyFormCapture form endpoint and skip building your own backend.

Start Free Trial

No credit card required · 5-minute setup