diff --git a/front/plugins/_publisher_apprise/apprise.py b/front/plugins/_publisher_apprise/apprise.py index 1ac77d7b..967074ed 100755 --- a/front/plugins/_publisher_apprise/apprise.py +++ b/front/plugins/_publisher_apprise/apprise.py @@ -78,7 +78,7 @@ def main(): #------------------------------------------------------------------------------- def check_config(): - if get_setting_value('APPRISE_URL') == '' or get_setting_value('APPRISE_HOST') == '': + if get_setting_value('APPRISE_HOST') == '' or (get_setting_value('APPRISE_URL') == '' and get_setting_value('APPRISE_TAG') == ''): return False else: return True @@ -106,10 +106,11 @@ 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" + target_key = "tag" if get_setting_value('APPRISE_TARGETTYPE') == 'tag' else "urls" + target_value = get_setting_value('APPRISE_TAG') if target_key == 'tag' else get_setting_value('APPRISE_URL') _json_payload = { - target_key: get_setting_value('APPRISE_URL'), + target_key: target_value, "title": "NetAlertX Notifications", "format": get_setting_value('APPRISE_PAYLOAD'), "body": payloadData diff --git a/front/plugins/_publisher_apprise/config.json b/front/plugins/_publisher_apprise/config.json index c3bc9e3d..7731bfbe 100755 --- a/front/plugins/_publisher_apprise/config.json +++ b/front/plugins/_publisher_apprise/config.json @@ -486,6 +486,38 @@ } ] }, + { + "function": "TAG", + "type": { + "dataType": "string", + "elements": [ + { "elementType": "input", "elementOptions": [], "transformers": [] } + ] + }, + "default_value": "", + "options": [], + "localized": ["name", "description"], + "name": [ + { + "language_code": "en_us", + "string": "Apprise notification tag" + }, + { + "language_code": "es_es", + "string": "Tag de notificación de Apprise" + } + ], + "description": [ + { + "language_code": "en_us", + "string": "Apprise notification target tag." + }, + { + "language_code": "es_es", + "string": "Informar de la tag de destino de la notificación." + } + ] + }, { "function": "PAYLOAD", "type": {