Enable Markdown and HTML notifications. (#288)

This change enable defining the notification body as HTML or Markdown. This can be very
useful to have more user-friendly notifications such as:
* applying a heading style to the `{watch_title}` to make it stand out
* creating clickable links using the `{watch_url}`, `{preview_url}` and `{diff_url}`.

Changes
=======
* Add a `notification_format` to the notification settings, defaults to plain text.
* Use the `body_format` parameter of Apprise's `notify` method.

Co-authored-by: Malo Jaffré <malo.jaffre@dunnhumby.com>
This commit is contained in:
ghjklw
2021-12-04 14:41:48 +01:00
committed by GitHub
parent ff6dc842c0
commit ecba130fdb
7 changed files with 37 additions and 5 deletions

View File

@@ -87,6 +87,7 @@ class update_worker(threading.Thread):
n_object['notification_urls'] = watch['notification_urls']
n_object['notification_title'] = watch['notification_title']
n_object['notification_body'] = watch['notification_body']
n_object['notification_format'] = watch['notification_format']
self.notification_q.put(n_object)
# No? maybe theres a global setting, queue them all
@@ -95,6 +96,7 @@ class update_worker(threading.Thread):
n_object['notification_urls'] = self.datastore.data['settings']['application']['notification_urls']
n_object['notification_title'] = self.datastore.data['settings']['application']['notification_title']
n_object['notification_body'] = self.datastore.data['settings']['application']['notification_body']
n_object['notification_format'] = self.datastore.data['settings']['application']['notification_format']
self.notification_q.put(n_object)
else:
print(">>> NO notifications queued, watch and global notification URLs were empty.")