From 04391551271ddf427d7decb35c482f2c3314b4dd Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Mon, 22 Jan 2024 11:06:55 +0100 Subject: [PATCH] Notification - Templates - Adding an example of how to use |tojson for JSON payloads --- changedetectionio/templates/_common_fields.jinja | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changedetectionio/templates/_common_fields.jinja b/changedetectionio/templates/_common_fields.jinja index fa113e17..ddccaf82 100644 --- a/changedetectionio/templates/_common_fields.jinja +++ b/changedetectionio/templates/_common_fields.jinja @@ -115,6 +115,9 @@ Warning: Contents of {{ '{{diff}}' }}, {{ '{{diff_removed}}' }}, and {{ '{{diff_added}}' }} depend on how the difference algorithm perceives the change.
For example, an addition or removal could be perceived as a change in some cases. More Here

+

+ For JSON payloads, use |tojson without quotes for automatic escaping, for example - { "name": {{ '{{ watch_title|tojson }}' }} } +