From 97e317148c501d99598b9d604b443dde68f43abf Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Sat, 16 Aug 2025 21:57:27 +0000 Subject: [PATCH] fix: webhook custom templates not being used when service field is empty - Fixed bug where custom webhook templates were being overwritten with generic payload - The issue occurred when a webhook had a custom template but empty service field - Now properly preserves custom template payloads regardless of service field value - Telegram webhooks and other custom template webhooks now work correctly - Addresses user reports of webhook delivery issues --- internal/notifications/notifications.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/notifications/notifications.go b/internal/notifications/notifications.go index 295ddca9d..b8dc6f8f9 100644 --- a/internal/notifications/notifications.go +++ b/internal/notifications/notifications.go @@ -770,7 +770,8 @@ func (n *NotificationManager) sendWebhook(webhook WebhookConfig, alert *alerts.A } // Use generic payload if no service or template not found - if webhook.Service == "" || webhook.Service == "generic" || jsonData == nil { + // But ONLY if jsonData hasn't been set yet (from custom template) + if jsonData == nil && (webhook.Service == "" || webhook.Service == "generic") { // Use generic payload for other services payload := map[string]interface{}{ "alert": alert,