From c62952e070a02eba89c8627707c7761152a2dcc9 Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Tue, 12 Aug 2025 09:47:05 +0000 Subject: [PATCH] fix: email test now uses saved password when not provided - Test email button now works without re-entering password - Backend uses saved password if test request has empty password - Fixes authentication error when testing email notifications --- internal/api/notifications.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/api/notifications.go b/internal/api/notifications.go index 0f1d63a88..a794021ea 100644 --- a/internal/api/notifications.go +++ b/internal/api/notifications.go @@ -268,6 +268,12 @@ func (h *NotificationHandlers) TestNotification(w http.ResponseWriter, r *http.R } } else if req.Method == "email" && req.Config != nil { // If config is provided, use it for testing (without saving) + // If password is empty, use the saved password + if req.Config.Password == "" { + savedConfig := h.monitor.GetNotificationManager().GetEmailConfig() + req.Config.Password = savedConfig.Password + } + log.Info(). Bool("enabled", req.Config.Enabled). Str("smtp", req.Config.SMTPHost).