From 2ee00a6c44f78531b38fb8a5dd27dfc5dc4740a6 Mon Sep 17 00:00:00 2001 From: Michael Reber Date: Sun, 8 Feb 2026 20:15:03 +0100 Subject: [PATCH] Skip sending if the destination email is still the default placeholder --- pkg/web/handlers.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/web/handlers.go b/pkg/web/handlers.go index a48a357..c015583 100644 --- a/pkg/web/handlers.go +++ b/pkg/web/handlers.go @@ -2527,6 +2527,12 @@ func isLOTRModeActive(alertCountries []string) bool { // * Unified Email Sending Function : * // ******************************************************************* func sendEmail(to, subject, body string, settings config.AppSettings) error { + // Skip sending if the destination email is still the default placeholder + if strings.EqualFold(strings.TrimSpace(to), "alerts@example.com") { + log.Printf("⚠️ sendEmail skipped: destination email is still the default placeholder (alerts@example.com). Please update the 'Destination Email' in Settings → Alert Settings.") + return errors.New("destination email is still the default (alerts@example.com) - please configure a valid address in Settings → Alert Settings") + } + // Validate SMTP settings if settings.SMTP.Host == "" || settings.SMTP.Username == "" || settings.SMTP.Password == "" || settings.SMTP.From == "" { err := errors.New("SMTP settings are incomplete. Please configure all required fields")