Skip to content

Commit

Permalink
Notifications - Fixing truncated notifications when tgram:// or disco…
Browse files Browse the repository at this point in the history
…rd:// is used with other notification methods (#2372 #2299)
  • Loading branch information
dgtlmoon committed May 17, 2024
1 parent e27f66e commit add2c65
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions changedetectionio/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ def process_notification(n_object, datastore):
# Insert variables into the notification content
notification_parameters = create_notification_parameters(n_object, datastore)

# Get the notification body from datastore
n_body = jinja_render(template_str=n_object.get('notification_body', ''), **notification_parameters)
n_title = jinja_render(template_str=n_object.get('notification_title', ''), **notification_parameters)

n_format = valid_notification_formats.get(
n_object.get('notification_format', default_notification_format),
valid_notification_formats[default_notification_format],
Expand All @@ -151,6 +147,11 @@ def process_notification(n_object, datastore):

with apprise.LogCapture(level=apprise.logging.DEBUG) as logs:
for url in n_object['notification_urls']:

# Get the notification body from datastore
n_body = jinja_render(template_str=n_object.get('notification_body', ''), **notification_parameters)
n_title = jinja_render(template_str=n_object.get('notification_title', ''), **notification_parameters)

url = url.strip()
if not url:
logger.warning(f"Process Notification: skipping empty notification URL.")
Expand Down

0 comments on commit add2c65

Please sign in to comment.