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.
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.
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.
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.
/newbotbot)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.
<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>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:32You can customise which fields appear and the message format in your form settings.
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.
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.
Create a free MyFormCapture form endpoint and skip building your own backend.
Start Free TrialNo credit card required · 5-minute setup