The LimeSurvey LSTelegramNotify plugin sends survey completion notifications to Telegram.
Useful improvements now available in this plugin include:
- global/per-survey
Enableswitch for notifications - a
Send test messagecontrol in global and survey-specific settings to validate the saved bot token and chat destination without using survey responses - HTML-safe rendering when using
ParseMode = HTML - Telegram Rich Messages for
ParseMode = HTML, including rich blocks such as headings, tables, details and media - plain
Textmode without Telegramparse_mode - extra URL placeholders for common survey/response actions
- mustache placeholders for survey question/answer/raw values
The image below is a locally generated preview of a rendered Telegram message using sample data:
- Copy the LSTelegramNotify folder to the Limesurvey "plugins" directory.
- Go to
LSTelegramNotifyfolder - Run
composer install --no-devinside of folderLSTelegramNotify(only the runtime dependency is needed to run the plugin) - Activate the plugin at the Limesurvey plugin manager (requires proper user rights for accessing the feature at the Limesurvey admin interface).
- Configure the plugin at the settings page
- Create a Telegram bot with @BotFather and copy the bot token.
- Add the bot to the Telegram group that should receive survey notifications.
- Get the group chat ID. One option is to temporarily add @RawDataBot to the group, read the
chat.idvalue it reports, and remove the bot afterwards. - Open the LSTelegramNotify settings in LimeSurvey.
- Set
Bot tokento the token created by BotFather andChat IDto the destination group ID. - Enable
Send a custom messageif you want a Telegram message for each completed response. When enabled, choose theMessage formatand edit theMessage template. - Enable the PDF and CSV options independently if you also want those files sent with each completed response.
- Save the settings, then use
Send test messageto verify that the saved bot token and chat destination work before relying on survey notifications.
The README screenshots below show the current plugin settings and a rendered Telegram notification example. They are generated and validated automatically by the repository screenshot workflow.
The linters, static analysis and test tools are managed as isolated
composer-bin sets. After
composer install, pull them with:
composer tools:install
You can then run composer test:unit, composer psalm and composer cs:check.
These placeholders work in both legacy and mustache syntax:
{title}/{{title}}{surveyId}/{{surveyId}}{responseId}/{{responseId}}{urlPDF}/{{urlPDF}}{urlSurvey}/{{urlSurvey}}{urlDetails}/{{urlDetails}}{urlEdit}/{{urlEdit}}{urlExport}/{{urlExport}}{urlAttachments}/{{urlAttachments}}
When Message format is HTML, the rendered template is sent through Telegram's sendRichMessage API using Rich HTML. This enables richer blocks such as headings, tables, <details> and media such as <img src="https://example.test/photo.jpg" />. All placeholder values are escaped before rendering so survey content cannot break the markup.
Use field codes in mustache syntax to inject survey questions and responses:
{{field:FIELD_CODE.question}}{{field:FIELD_CODE.answer}}{{field:FIELD_CODE.raw}}
Shorthand aliases are also available:
{{FIELD_CODE}}{{FIELD_CODE_answer}}{{answer_FIELD_CODE}}{{raw_FIELD_CODE}}
The global plugin settings screen documents the available placeholders directly in the UI:
The global plugin settings and each survey-specific settings page include a Send test message control. Save the settings first, then use the control to send a fixed plain-text message to the configured Telegram chat.
The test does not render the survey template and does not read or transmit survey responses. In survey settings it uses the effective survey configuration, including fallback to saved global AuthToken and ChatId values.
You can add custom settings by survey to send the messages to other groups, customize the text and change other settings.
- Go to survey settings
- GO to
Simple plugins - Define your custom settings at
Settings for plugin LSTelegramNotify

