diff --git a/internal/api/notifications.go b/internal/api/notifications.go index 04ed7a7f5a..cc9d1ebc05 100644 --- a/internal/api/notifications.go +++ b/internal/api/notifications.go @@ -249,6 +249,10 @@ func (h *NotificationHandlers) GetWebhooks(w http.ResponseWriter, r *http.Reques whMap["template"] = webhook.Template } + if webhook.Mention != "" { + whMap["mention"] = webhook.Mention + } + maskedWebhooks[i] = whMap } diff --git a/internal/api/notifications_test.go b/internal/api/notifications_test.go index 9199321a4c..2ab9ea6646 100644 --- a/internal/api/notifications_test.go +++ b/internal/api/notifications_test.go @@ -358,6 +358,7 @@ func TestNotificationHandlers(t *testing.T) { Name: "Test Webhook", URL: "https://example.com", Headers: map[string]string{"Authorization": "Bearer token"}, + Mention: "@everyone", }, } mockManager.On("GetWebhooks").Return(webhooks).Once() @@ -371,6 +372,7 @@ func TestNotificationHandlers(t *testing.T) { json.Unmarshal(w.Body.Bytes(), &resp) assert.Equal(t, 1, len(resp)) assert.Equal(t, "wh1", resp[0]["id"]) + assert.Equal(t, "@everyone", resp[0]["mention"]) headers := resp[0]["headers"].(map[string]interface{}) assert.Equal(t, "***REDACTED***", headers["Authorization"]) })