mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Review comments
This commit is contained in:
@@ -106,21 +106,15 @@ def send(html, text):
|
||||
|
||||
# Define Apprise compatible payload (https://github.com/caronc/apprise-api#stateless-solution)
|
||||
|
||||
target_key = "tags" if get_setting_value('APPRISE_TARGETTYPE') == 'tag' else "urls"
|
||||
|
||||
_json_payload = {
|
||||
"urls": get_setting_value('APPRISE_URL'),
|
||||
target_key: get_setting_value('APPRISE_URL'),
|
||||
"title": "NetAlertX Notifications",
|
||||
"format": get_setting_value('APPRISE_PAYLOAD'),
|
||||
"body": payloadData
|
||||
}
|
||||
|
||||
if get_setting_value('APPRISE_TARGETTYPE') == 'tag':
|
||||
_json_payload = {
|
||||
"tag": get_setting_value('APPRISE_URL'),
|
||||
"title": "NetAlertX Notifications",
|
||||
"format": get_setting_value('APPRISE_PAYLOAD'),
|
||||
"body": payloadData
|
||||
}
|
||||
|
||||
try:
|
||||
# try runnning a subprocess
|
||||
p = subprocess.Popen(["curl","-i","-X", "POST" ,"-H", "Content-Type:application/json" ,"-d", json.dumps(_json_payload), get_setting_value('APPRISE_HOST')], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
|
||||
Reference in New Issue
Block a user