From 7d76ddc07b29002f88f488880dab51b795e405fe Mon Sep 17 00:00:00 2001 From: zvldz <45265234+zvldz@users.noreply.github.com> Date: Wed, 23 Feb 2022 20:36:06 +0200 Subject: [PATCH] Extra data attributes for telegram.notify (#21129) Co-authored-by: root Co-authored-by: Franck Nijhof --- source/_integrations/telegram.markdown | 30 ++++++++++++++++++++++ source/_integrations/telegram_bot.markdown | 14 +++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/source/_integrations/telegram.markdown b/source/_integrations/telegram.markdown index cef6b4e2e4d..2cf47e4fe4e 100644 --- a/source/_integrations/telegram.markdown +++ b/source/_integrations/telegram.markdown @@ -377,3 +377,33 @@ inline_keyboard: required: false type: list {% endconfiguration %} + +### Extra data attributes support + +```yaml +... +action: + service: notify.NOTIFIER_NAME + data: + title: "*Send a message*" + message: "That's an example that sends a message with message_tag and disable_notification." + data: + message_tag: "example_tag" + disable_notification: True +``` + +{% configuration %} +parse_mode: + description: "Parser for the message text: `markdownv2`, `html` or `markdown`." + required: false + type: string +disable_notification: + description: True/false to send the message silently. iOS users and web users will not receive a notification. Android users will receive a notification with no sound. + required: false + default: false + type: boolean +message_tag: + description: Tag for sent message. + required: false + type: string +{% endconfiguration %} diff --git a/source/_integrations/telegram_bot.markdown b/source/_integrations/telegram_bot.markdown index 144d76721c0..f9edd3990a9 100644 --- a/source/_integrations/telegram_bot.markdown +++ b/source/_integrations/telegram_bot.markdown @@ -236,7 +236,7 @@ Remove the bot from the chat group where it was added. ## Telegram notification platform -The [`telegram` notification platform](/integrations/telegram) requires the `telegram_bot` integration to work with, and it's designed to generate a customized shortcut (`notify.USERNAME`) to send notifications (messages, photos, documents and locations) to a particular `chat_id` with the old syntax, allowing backward compatibility. +The [`telegram` notification platform](/integrations/telegram) requires the `telegram_bot` integration to work with, and it's designed to generate a customized shortcut (`notify.USERNAME`) to send notifications (messages, photos, documents and locations) to a particular `chat_id` with the old syntax, allowing backward compatibility. The data attributes `parse_mode`, `disable_notification` and `message_tag` are also supported. The required YAML configuration now reduces to: @@ -527,3 +527,15 @@ action: title: Example Message message: 'Message with *BOLD*, _ITALIC_ and `MONOSPACE` Text' ``` + +## Example: send_message with message tag + +```yaml +action: +- service: notify.telegrambot + data: + title: Example Message + message: "Message with tag" + data: + message_tag: "example_tag" +```