From 14f1a44c7a68c3c33a5aac6c51237718dd3efbd6 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Fri, 6 Dec 2024 17:21:52 +1300 Subject: [PATCH] Feature: Include Mailpit label (if set) in webhook HTTP header (#400) --- server/webhook/webhook.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/webhook/webhook.go b/server/webhook/webhook.go index bbb4abf9eb..de16fb2899 100644 --- a/server/webhook/webhook.go +++ b/server/webhook/webhook.go @@ -54,6 +54,10 @@ func Send(msg interface{}) { req.Header.Set("User-Agent", "Mailpit/"+config.Version) req.Header.Set("Content-Type", "application/json") + if config.Label != "" { + req.Header.Set("Mailpit-Label", config.Label) + } + client := &http.Client{} resp, err := client.Do(req) if err != nil {