diff --git a/changedetectionio/flask_app.py b/changedetectionio/flask_app.py index 21d2c68f..f077e688 100644 --- a/changedetectionio/flask_app.py +++ b/changedetectionio/flask_app.py @@ -1592,6 +1592,15 @@ def notification_runner(): try: from changedetectionio import notification + # Fallback to system config if not set + if not n_object.get('notification_body') and datastore.data['settings']['application'].get('notification_body'): + n_object['notification_body'] = datastore.data['settings']['application'].get('notification_body') + + if not n_object.get('notification_title') and datastore.data['settings']['application'].get('notification_title'): + n_object['notification_title'] = datastore.data['settings']['application'].get('notification_title') + + if not n_object.get('notification_format') and datastore.data['settings']['application'].get('notification_format'): + n_object['notification_title'] = datastore.data['settings']['application'].get('notification_format') sent_obj = notification.process_notification(n_object, datastore) diff --git a/changedetectionio/notification.py b/changedetectionio/notification.py index d3a475e7..4c50ef9e 100644 --- a/changedetectionio/notification.py +++ b/changedetectionio/notification.py @@ -119,8 +119,8 @@ def process_notification(n_object, datastore): # Get the notification body from datastore jinja2_env = Environment(loader=BaseLoader) - n_body = jinja2_env.from_string(n_object.get('notification_body', default_notification_body)).render(**notification_parameters) - n_title = jinja2_env.from_string(n_object.get('notification_title', default_notification_title)).render(**notification_parameters) + n_body = jinja2_env.from_string(n_object.get('notification_body', '')).render(**notification_parameters) + n_title = jinja2_env.from_string(n_object.get('notification_title', '')).render(**notification_parameters) n_format = valid_notification_formats.get( n_object.get('notification_format', default_notification_format), valid_notification_formats[default_notification_format],