diff --git a/backend/internal/api/handlers/notification_provider_blocker3_test.go b/backend/internal/api/handlers/notification_provider_blocker3_test.go index 058d4da2..3d71d38e 100644 --- a/backend/internal/api/handlers/notification_provider_blocker3_test.go +++ b/backend/internal/api/handlers/notification_provider_blocker3_test.go @@ -40,7 +40,7 @@ func TestBlocker3_CreateProviderRejectsNonDiscordWithSecurityEvents(t *testing.T {"webhook", "webhook", http.StatusCreated}, {"gotify", "gotify", http.StatusCreated}, {"slack", "slack", http.StatusBadRequest}, - {"email", "email", http.StatusBadRequest}, + {"email", "email", http.StatusCreated}, } for _, tc := range testCases { diff --git a/backend/internal/api/handlers/notification_provider_discord_only_test.go b/backend/internal/api/handlers/notification_provider_discord_only_test.go index 81b635eb..24826a83 100644 --- a/backend/internal/api/handlers/notification_provider_discord_only_test.go +++ b/backend/internal/api/handlers/notification_provider_discord_only_test.go @@ -38,7 +38,7 @@ func TestDiscordOnly_CreateRejectsNonDiscord(t *testing.T) { {"slack", "slack", http.StatusBadRequest, "UNSUPPORTED_PROVIDER_TYPE"}, {"telegram", "telegram", http.StatusBadRequest, "UNSUPPORTED_PROVIDER_TYPE"}, {"generic", "generic", http.StatusBadRequest, "UNSUPPORTED_PROVIDER_TYPE"}, - {"email", "email", http.StatusBadRequest, "UNSUPPORTED_PROVIDER_TYPE"}, + {"email", "email", http.StatusCreated, ""}, } for _, tc := range testCases { diff --git a/backend/internal/api/handlers/notification_provider_handler.go b/backend/internal/api/handlers/notification_provider_handler.go index 2dc406f3..2584b39f 100644 --- a/backend/internal/api/handlers/notification_provider_handler.go +++ b/backend/internal/api/handlers/notification_provider_handler.go @@ -168,7 +168,7 @@ func (h *NotificationProviderHandler) Create(c *gin.Context) { } providerType := strings.ToLower(strings.TrimSpace(req.Type)) - if providerType != "discord" && providerType != "gotify" && providerType != "webhook" { + if providerType != "discord" && providerType != "gotify" && providerType != "webhook" && providerType != "email" { respondSanitizedProviderError(c, http.StatusBadRequest, "UNSUPPORTED_PROVIDER_TYPE", "validation", "Unsupported notification provider type") return } @@ -228,7 +228,7 @@ func (h *NotificationProviderHandler) Update(c *gin.Context) { } providerType := strings.ToLower(strings.TrimSpace(existing.Type)) - if providerType != "discord" && providerType != "gotify" && providerType != "webhook" { + if providerType != "discord" && providerType != "gotify" && providerType != "webhook" && providerType != "email" { respondSanitizedProviderError(c, http.StatusBadRequest, "UNSUPPORTED_PROVIDER_TYPE", "validation", "Unsupported notification provider type") return } diff --git a/backend/internal/services/mail_service.go b/backend/internal/services/mail_service.go index 5d306d67..499fdac8 100644 --- a/backend/internal/services/mail_service.go +++ b/backend/internal/services/mail_service.go @@ -393,7 +393,6 @@ func (s *MailService) SendEmail(ctx context.Context, to []string, subject, htmlB auth = smtp.PlainAuth("", config.Username, config.Password, config.Host) } - htmlBody = sanitizeAndNormalizeHTMLBody(htmlBody) htmlBody = sanitizeEmailContent(htmlBody) for _, recipient := range to {