From 69c3d5a3fb87726c2cdb4c182be609dc40d73c80 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Fri, 13 Dec 2024 10:43:04 +0100 Subject: [PATCH] the notificaiton template itself should be converted to
html from plaintext --- changedetectionio/notification.py | 3 +++ changedetectionio/tests/test_notification.py | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changedetectionio/notification.py b/changedetectionio/notification.py index 4dac610f..e7ca67a3 100644 --- a/changedetectionio/notification.py +++ b/changedetectionio/notification.py @@ -77,6 +77,9 @@ def process_notification(n_object, datastore): # Get the notification body from datastore n_body = jinja_render(template_str=n_object.get('notification_body', ''), **notification_parameters) + if n_object.get('notification_format', '').startswith('HTML'): + n_body = n_body.replace("\n", '
') + n_title = jinja_render(template_str=n_object.get('notification_title', ''), **notification_parameters) url = url.strip() diff --git a/changedetectionio/tests/test_notification.py b/changedetectionio/tests/test_notification.py index e43f81f5..8177071e 100644 --- a/changedetectionio/tests/test_notification.py +++ b/changedetectionio/tests/test_notification.py @@ -442,7 +442,6 @@ def test_global_send_test_notification(client, live_server, measure_memory_usage assert b"Error: You must have atleast one watch configured for 'test notification' to work" in res.data -#2510 def test_html_color_notifications(client, live_server, measure_memory_usage): #live_server_setup(live_server)