diff --git a/README.md b/README.md
index 395e3ac8..839a5c13 100644
--- a/README.md
+++ b/README.md
@@ -90,10 +90,11 @@ Just some examples
+Now you can also customise your notification content!
+
### JSON API Monitoring
-Detect changes and monitor data in JSON API's by using the built-in JSONPath selectors as a filter.
-
+Detect changes and monitor data in JSON API's by using the built-in JSONPath selectors as a filter / selector.

@@ -101,7 +102,6 @@ This will re-parse the JSON and apply indent to the text, making it super easy t

-
### Proxy
A proxy for ChangeDetection.io can be configured by setting environment the
diff --git a/backend/__init__.py b/backend/__init__.py
index 1b668087..3c9b650e 100644
--- a/backend/__init__.py
+++ b/backend/__init__.py
@@ -422,7 +422,8 @@ def changedetection_app(config=None, datastore_o=None):
if form.trigger_check.data:
n_object = {'watch_url': form.url.data.strip(),
- 'notification_urls': form.notification_urls.data}
+ 'notification_urls': form.notification_urls.data,
+ 'uuid': uuid}
notification_q.put(n_object)
flash('Notifications queued.')
@@ -463,6 +464,8 @@ def changedetection_app(config=None, datastore_o=None):
form.minutes_between_check.data = int(datastore.data['settings']['requests']['minutes_between_check'])
form.notification_urls.data = datastore.data['settings']['application']['notification_urls']
form.extract_title_as_title.data = datastore.data['settings']['application']['extract_title_as_title']
+ form.notification_title.data = datastore.data['settings']['application']['notification_title']
+ form.notification_body.data = datastore.data['settings']['application']['notification_body']
# Password unset is a GET
if request.values.get('removepassword') == 'true':
@@ -476,6 +479,8 @@ def changedetection_app(config=None, datastore_o=None):
datastore.data['settings']['application']['notification_urls'] = form.notification_urls.data
datastore.data['settings']['requests']['minutes_between_check'] = form.minutes_between_check.data
datastore.data['settings']['application']['extract_title_as_title'] = form.extract_title_as_title.data
+ datastore.data['settings']['application']['notification_title'] = form.notification_title.data
+ datastore.data['settings']['application']['notification_body'] = form.notification_body.data
if len(form.notification_urls.data):
import apprise
@@ -823,39 +828,22 @@ def check_for_new_version():
app.config.exit.wait(86400)
def notification_runner():
-
while not app.config.exit.is_set():
try:
# At the moment only one thread runs (single runner)
n_object = notification_q.get(block=False)
except queue.Empty:
time.sleep(1)
- pass
else:
- import apprise
-
- # Create an Apprise instance
+ # Process notifications
try:
- apobj = apprise.Apprise()
- for url in n_object['notification_urls']:
- apobj.add(url.strip())
-
- n_body = n_object['watch_url']
-
- # 65 - Append URL of instance to the notification if it is set.
- base_url = os.getenv('BASE_URL')
- if base_url != None:
- n_body += "\n" + base_url
-
- apobj.notify(
- body=n_body,
- # @todo This should be configurable.
- title="ChangeDetection.io Notification - {}".format(n_object['watch_url'])
- )
+ from backend import notification
+ notification.process_notification(n_object, datastore)
except Exception as e:
- print("Watch URL: {} Error {}".format(n_object['watch_url'],e))
+ print("Watch URL: {} Error {}".format(n_object['watch_url'], e))
+
# Thread runner to check every minute, look for new watches to feed into the Queue.
diff --git a/backend/forms.py b/backend/forms.py
index 72bda422..a2739030 100644
--- a/backend/forms.py
+++ b/backend/forms.py
@@ -152,3 +152,6 @@ class globalSettingsForm(Form):
notification_urls = StringListField('Notification URL List')
extract_title_as_title = BooleanField('Extract