summaryrefslogtreecommitdiff
path: root/internal/state.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-18 22:19:11 +0200
committerPaul Buetow <paul@buetow.org>2026-01-18 22:19:11 +0200
commit64c4f058e6f9975effb38e952531458054f512c3 (patch)
tree592b43fad5805e6d1664ba79b58ff1e7b357edfc /internal/state.go
parent1f20bed4e77d2238e2b613b060fd05adb58ba116 (diff)
add status page URL to email notifications
Include a configurable link to the HTML status page in email notifications. Defaults to https://gogios.buetow.org but can be customized via the StatusPageURL config option. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/state.go')
-rw-r--r--internal/state.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/state.go b/internal/state.go
index 516e63a..cb2c665 100644
--- a/internal/state.go
+++ b/internal/state.go
@@ -130,7 +130,9 @@ func (s state) persist() error {
return os.WriteFile(s.stateFile, jsonData, os.ModePerm)
}
-func (s state) report(renotify, force bool) (string, string, bool) {
+// report generates the notification email content.
+// statusPageURL is included as a link to the HTML status page.
+func (s state) report(renotify, force bool, statusPageURL string) (string, string, bool) {
var sb strings.Builder
sb.WriteString("This is the recent Gogios report!\n\n")
@@ -154,6 +156,10 @@ func (s state) report(renotify, force bool) (string, string, bool) {
sb.WriteString("There are no stale alerts...\n\n")
}
+ sb.WriteString("# Status page:\n\n")
+ sb.WriteString(statusPageURL)
+ sb.WriteString("\n\n")
+
sb.WriteString("Have a nice day!\n")
subject := fmt.Sprintf("GOGIOS Report [C:%d W:%d U:%d S:%d OK:%d]",