fix: escape Telegram MarkdownV2 after template rendering#6579
fix: escape Telegram MarkdownV2 after template rendering#6579CommanderStorm merged 3 commits intolouislam:masterfrom
Conversation
CommanderStorm
left a comment
There was a problem hiding this comment.
a second renderTemplate in the telegram monitor is a non-starter for us.
Please remove this and pull only the escaping into the telgram notification provider instead.
Also, plese share a screenshot of this working (with 100s of notification providers, I cannot do this myself and you have already tested this)
It looks like double work going on with this: The test template: |
|
@iotux With the latest changes applied, MarkdownV2 escaping now works correctly Test Template: |
|
Thanks for working on fixing this issue you two ❤️ |


📝 Summary
This pull request fixes telegram notification failures when using MarkdownV2 together with custom message templates.
currently, template variables such as {{ hostnameOrURL }}, {{ monitorJSON }}, or {{ heartbeatJSON }} may contain characters reserved by telegram MarkdownV2 syntax (e.g. ., -, _, {}, etc.). These characters are not escaped, causing telegram API errors and making templates effectively unusable.
This change ensures that when MarkdownV2 is selected, all template values are safely escaped before sending the message to telegram. This removes the need for users to manually escape content they do not control and aligns behavior with telegram MarkdownV2 specification.
The change is scoped only to the telegram provider and does not affect other providers or parse modes.
📋 Related issues
Resolves #6549
📄 Checklist
Please follow this checklist to avoid unnecessary back and forth (click to expand)
I understand that I am responsible for and able to explain every line of code I submit.