serge-pro-dev

telegram

by serge-pro-dev
payload-plugins
Notifications & messaging
v4
^4.0.0-beta.12
MIT

Overview

Summary generated from the README

Adds a Telegram notification block to forms created with the Payload form builder plugin. Each form can have several notifications, each with its own bot token, chat ID and message template. Delivery runs inside the form request by default or through Payload Jobs. Requires Payload 4 and must be registered after the form builder plugin.

Features

  • Multiple Telegram notifications per form, each with its own bot and chat
  • Message templates with form field placeholders and an all-answers list
  • Optional UTM first-touch, last-touch or both attribution read from cookies
  • Sync delivery or queued delivery through Payload Jobs with retries
  • Per-notification enable toggle and configurable request timeout
  • Admin labels in English and Russian

Use cases

  • Notify a sales team group chat when a contact form is submitted
  • Track which marketing campaign produced each lead by including UTM data in messages
  • Send form alerts to different bots or chats depending on the form

From the author

Telegram notifications for Payload CMS 4 form builder submissions, with UTM data and optional queue delivery.

Installation

npm i @serge-pro-dev/payload-plugin-telegram

0

Stars

0

Forks

0

Open Issues

Yesterday

Last Updated

499

Weekly Downloads

v0.1.0-beta.1

npm Version

65.1 KB

Unpacked Size

1

Dependencies

Repository stars

00 since Nov 29

Show data
Repository stars by day (UTC)
DateStars
Dec 6, 20260
Dec 5, 20260
Dec 4, 20260
Dec 3, 20260
Dec 2, 20260
Dec 1, 20260
Nov 30, 20260
Nov 29, 20260

Shared by 6 plugins in serge-pro-dev/payload-plugins.

npm weekly downloads

Trends appear after 7 days of data. Collecting since Dec 4 — 3 daily snapshots so far.

Each point is npm's rolling 7-day download count.

Health Score

76/100Excellent

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1479182369-telegram.svg)](https://payloaddirectory.dev/plugins/1479182369-telegram)
HTML
<a href="https://payloaddirectory.dev/plugins/1479182369-telegram"><img src="https://payloaddirectory.dev/badge/1479182369-telegram.svg" alt="Payload Directory"></a>
Updated Dec 4, 2026Created Dec 1, 2026Published Dec 3, 2026

README

@serge-pro-dev/payload-plugin-telegram

Русская версия

Sends a Telegram message when a Payload CMS 4 form (form builder plugin) is submitted. Several notifications per form are possible (different bots or chats).

Telegram Notification

Install

pnpm add @serge-pro-dev/payload-plugin-telegram
// payload.config.ts: after formBuilderPlugin
import { telegramPlugin } from '@serge-pro-dev/payload-plugin-telegram'

plugins: [formBuilderPlugin(/* ... */), telegramPlugin()]

Then run pnpm payload generate:types. Queue delivery is optional: telegramPlugin({ delivery: 'queue' }), see delivery.

Setup

  1. Create a bot with @BotFather and copy the token.
  2. Add the bot to the chat or group (or press Start in a private chat with it) and get the chat ID.
  3. Open a form → block Telegram → + Add Telegram Notification.
FieldPurpose
EnabledOn by default. Switch off to pause the notification without deleting it
Telegram Bot Token / Chat IDBot and destination (both required)
MessageMessage template
Send UTM / UTM AttributionAdd UTM data: First Touch, Last Touch or Both

Message template

  • {{fieldName}} — value of a form field.
  • {{*}} — all answers, {{*:table}} — all answers as a formatted list.
  • UTM (when Send UTM is on): {{utm.source}}, {{utm.medium}}, {{utm.campaign}}, {{utm.term}}, {{utm.content}}, {{utm.landing_page}}, {{utm.referrer}} and the click IDs {{utm.gclid}}, {{utm.yclid}}, {{utm.fbclid}}, {{utm.msclkid}}. With Both use {{utm.first.source}} and {{utm.last.source}}.
  • If the template has no {{utm.*}} placeholder, a UTM block is appended automatically.
  • Plain text, up to 4096 characters (longer messages are cut).

UTM is read from the utm_first_touch / utm_last_touch cookies, which something on the site must write: <UtmTracker /> from @serge-pro-dev/payload-plugins-shared/utm/next, the analytics plugin or your own script.

Options

OptionPurpose
delivery'sync' (default) sends inside the form request, 'queue' uses Payload Jobs
queuePayload Jobs queue name, default default
timeoutMsTimeout of every Telegram request, default 8000

Delivery

sync sends inside the form request (8 s timeout), queue uses Payload Jobs with retries; one job per notification. Wrong token or chat is logged and not retried.

Security

The bot token is stored in the form (database) as plain text. The telegram field is readable and editable only by logged-in users, and the token is never logged or stored in jobs.

Admin language

Labels are available in English and Russian. Enable both in the project: i18n: { supportedLanguages: { en, ru } }.

Database

The telegram array is stored in forms_telegram. In production run pnpm payload migrate:create and migrate after installing or updating the plugin.

MIT

Similar plugins