From 32900ee652b935cf6974074588b7e2e8741feb67 Mon Sep 17 00:00:00 2001 From: BroodjeAap Date: Thu, 29 Dec 2022 11:21:41 +0000 Subject: [PATCH] apprise checks at the end if notifying was succesfull --- notifiers/apprise.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/notifiers/apprise.go b/notifiers/apprise.go index 69ac739..46482b3 100644 --- a/notifiers/apprise.go +++ b/notifiers/apprise.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "log" "net/http" + "strings" "github.com/spf13/viper" ) @@ -85,7 +86,10 @@ func (apprise *AppriseNotifier) Message(message string) bool { log.Println("Could not parse Apprise response:", err) return false } - log.Println(string(body)) + bdy := string(body) + if !strings.Contains(bdy, "Notification(s) sent.") { + log.Println("Sending notifications failed:", bdy) + } return true }