Extra data attributes for telegram.notify (#21129)

Co-authored-by: root <zvldz@users.noreply.github.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
zvldz 2022-02-23 20:36:06 +02:00 committed by GitHub
parent 5199537940
commit 7d76ddc07b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 1 deletions

View File

@ -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 %}

View File

@ -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"
```