-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Html emails #2514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Html emails #2514
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ The `telegram` platform uses [Telegram](https://web.telegram.org) to delivery no | |
| The requirements are: | ||
|
|
||
| - You need a [Telegram bot](https://core.telegram.org/bots). Please follow those [instructions](https://core.telegram.org/bots#6-botfather) to create one and get the token for your bot. Keep in mind that bots are not allowed to contact users. You need to make the first contact with your user. Meaning that you need to send a message to the bot from your user. | ||
| - The `chat_id` of an user. | ||
| - The `chat_id` of an user, or a list of `user_id`s for sending messages to multiple users. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Separate changes to telegram out to it's own PR. |
||
|
|
||
| To retrieve your `chat_id`, contact any of the Telegram bots created for this purpose (@myidbot, @get_id_bot) | ||
|
|
||
|
|
@@ -51,16 +51,39 @@ notify: | |
| platform: telegram | ||
| api_key: ABCDEFGHJKLMNOPQRSTUVXYZ | ||
| chat_id: YOUR_CHAT_ID | ||
|
|
||
| # With more than one authorized target: | ||
| notify: | ||
| - name: NOTIFIER_NAME | ||
| platform: telegram | ||
| api_key: ABCDEFGHJKLMNOPQRSTUVXYZ | ||
| user_id: | ||
| User_name_1: CHAT_ID_USER_1 | ||
| User_name_2: CHAT_ID_USER_2 | ||
| ``` | ||
|
|
||
| Configuration variables: | ||
|
|
||
| - **name** (*Optional*): Setting the optional parameter `name` allows multiple notifiers to be created. The default value is `notify`. The notifier will bind to the service `notify.NOTIFIER_NAME`. | ||
| - **api_key** (*Required*): The API token of your bot. | ||
| - **chat_id** (*Required*): The chat ID of your user. | ||
| - **chat_id** (*Optional*): The chat ID of your user. | ||
| - **user_id** (*Optional*): Multiple chat IDs for multiple users. | ||
| - **parse_mode** (*Optional*): Default parser for messages if not explicit in message data: 'html' or 'markdown'. Default is 'markdown'. | ||
|
|
||
| To use notifications, please see the [getting started with automation page](/getting-started/automation/). | ||
|
|
||
| ### {% linkable_title Common message data parameters %} | ||
|
|
||
| - **message** (*Required*): Message text. | ||
| - **title** (*Optional*): Will be composed as '%title\n%message'. | ||
| - **parse_mode** (*Optional*): Parser for the message text: 'html' or 'markdown'. | ||
| - **timeout** (*Optional*): If this value is specified, use it as the definitive timeout (in seconds) for urlopen() operations. | ||
| - **disable_notification** (*Optional*): Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound. | ||
| - **disable_web_page_preview** (*Optional*): Disables link previews for links in the message. | ||
| - **reply_to_message_id** (*Optional*): If the message is a reply, ID of the original message. | ||
| - **keyboard** (*Optional*): List of rows of commands, comma-separated, to make a custom keyboard. | ||
| - **inline_keyboard** (*Optional*): List of rows of commands, comma-separated, to make a custom inline keyboard with buttons with asociated callback data. | ||
|
|
||
| ### {% linkable_title Photo support %} | ||
|
|
||
| ```yaml | ||
|
|
@@ -86,6 +109,7 @@ action: | |
| - **username** (*Optional*): Username for a URL which require HTTP basic authentication. | ||
| - **password** (*Optional*): Username for a URL which require HTTP basic authentication. | ||
|
|
||
|
|
||
| ### {% linkable_title Document support %} | ||
|
|
||
| ```yaml | ||
|
|
@@ -127,3 +151,69 @@ action: | |
| - **latitude** (*Required*): The latitude to send. | ||
| - **longitude** (*Required*): The longitude to send. | ||
|
|
||
| ### {% linkable_title Answering callback queries %} | ||
|
|
||
| To send a quick answer when receiving a [callback query event](/_components/telegram_bot.markdown/) sent from an inline keyboard. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. | ||
|
|
||
| ```yaml | ||
| ... | ||
| trigger: | ||
| platform: event | ||
| event_type: telegram_callback | ||
| action: | ||
| - service: notify.NOTIFIER_NAME | ||
| data: | ||
| message: "OK, I'm listening" | ||
| data: | ||
| callback_query: | ||
| callback_query_id: '{{ trigger.event.data.id }}' | ||
| show_alert: false | ||
| ``` | ||
|
|
||
| - **callback_query** (*Required*): | ||
| - **callback_query_id** (*Required*): Unique id of the callback response. | ||
| - **show_alert** (*Optional*): Show a permanent notification. | ||
|
|
||
| ### {% linkable_title Editing messages sent previously %} | ||
|
|
||
| You can edit a message (`edit_message`) or a image caption (`edit_caption`) from a previusly sent message: | ||
|
|
||
| ```yaml | ||
| ... | ||
| action: | ||
| - service: notify.NOTIFIER_NAME | ||
| data_template: | ||
| title: '*Message edit*' | ||
| message: 'This is the new text of the message' | ||
| data: | ||
| edit_message: | ||
| message_id: '{{ trigger.event.data.message.message_id }}' | ||
| disable_notification: true | ||
| inline_keyboard: | ||
| - '/edit,/NO' | ||
| - '/remove button' | ||
| ... | ||
| ``` | ||
|
|
||
| - **edit_message** or **edit_caption** (*Required*): | ||
| - **message_id** or **inline_message_id** (*Required*): id of the message to be edited. | ||
|
|
||
| or change the keyboard or the inline keyboard of the message of origin (`edit_replymarkup`): | ||
|
|
||
| ```yaml | ||
| ... | ||
| action: | ||
| - service: notify.NOTIFIER_NAME | ||
| data: | ||
| message: '' | ||
| edit_replymarkup: | ||
| message_id: 'last' | ||
| disable_notification: true | ||
| inline_keyboard: | ||
| - '/edit,/NO' | ||
| ... | ||
| ``` | ||
|
|
||
| - **edit_replymarkup** (*Required*): | ||
| - **message_id** or **inline_message_id** (*Required*): id of the message to be edited. | ||
| - **keyboard** or **inline_keyboard** (*Required*): New keyboard. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add ` # Example configuration.yaml entry``in the top of this example.