From 5f85c78d5780d3cd8bc094f74931dba47864a6bd Mon Sep 17 00:00:00 2001 From: "Erik J. Olson" Date: Thu, 30 Jun 2022 14:17:09 -0500 Subject: [PATCH] Add Matrix HTML format message documentation (#22372) Co-authored-by: Franck Nijhof --- source/_integrations/matrix.markdown | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/_integrations/matrix.markdown b/source/_integrations/matrix.markdown index e4c44b39e92..8d6d1b62228 100644 --- a/source/_integrations/matrix.markdown +++ b/source/_integrations/matrix.markdown @@ -183,6 +183,24 @@ The target room has to be precreated, the room id can be obtained from the rooms To use notifications, please see the [getting started with automation page](/getting-started/automation/). + +### Message formats + +Matrix supports sending messages using a [limited HTML subset](https://spec.matrix.org/v1.2/client-server-api/#mroommessage-msgtypes). To specify the message format, add it in the notification `data`. + +Supported formats are: `text` (default), and `html`. + +```yaml +# Example of notification as HTML +action: + service: notify.matrix_notify + data: + message: >- +

Hello, world!

+ data: + format: "html" +``` + ### Images in notification It is possible to send images with notifications. To do so, add a list of paths in the notification `data`.