BEILOFF Toolkit / v1.1.1

Contact form with Telegram delivery

Turn a confirmed website enquiry into one Telegram message with the visitor’s email and brief. Preview the exact message locally before creating a bot.

How the kit works

Enter the enquiry

The visitor adds a reply email and a short brief. Submitting with missing details focuses the first invalid field and explains what to change.

Review and edit

A single screen shows the email and the full brief. Visitors can go back to edit. Confirmation disables repeat clicks while the adapter is pending. A failed attempt keeps the details ready for retry.

Deliver to the team

In preview mode the page shows the outgoing message. In connected mode the server sends that text to the configured chat. The form confirms success when the Bot API acknowledges delivery.

Inside the ZIP

  • README.md
  • index.html
  • en.html
  • form.css
  • form.js
  • transport.js
  • http-transport.js
  • server.mjs
  • telegram.mjs
  • telegram.test.mjs
  • RELEASE.txt

The example runs as one Node.js process and remembers duplicate identifiers for one hour. If delivery cannot be confirmed, check the chat. Multiple processes need shared storage. The bot token stays on the server.

Getting started

  1. Unzip and run node server.mjs on Node.js 24. Open the printed address and submit a sample enquiry to preview the message. Open en.html from disk for the standalone UI.
  2. Create a bot with @BotFather. Start a conversation or add the bot to the team chat. Set TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID on the server and run node server.mjs --live.
  3. Expose POST /api/enquiry on the same HTTPS origin as your site. Adjust the form, message formatting and CSS separately. README.md covers the destination and your first live delivery check.

Change the colours and logo

Change --brand and --on-brand in form.css for both the default and dark themes. Replace BEILOFF / Forms in the headers of index.html and en.html with your name or an image with alt text. Test entry, confirmation and errors using a keyboard at mobile width. Telegram controls the incoming message appearance.

Verify the result

Run node --test telegram.test.mjs for message formatting, failed requests, concurrent attempts and lost acknowledgements. Then send a test enquiry to your own chat.

Telegram Bot API · sendMessage

Release notes

v1.1.1

Added colour and logo customisation instructions to the README.

v1.1.0

Added a Node.js handler, local message preview and Telegram Bot API delivery. The standalone form still runs from disk.

v1.0.0

First edition with two languages, three enquiry screens, field validation and a submission adapter.

Download free in my account