mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-25 04:33:03 +00:00
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
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user