High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.
JavaScript campaigncampaign-managementemail-marketingemail-subscriptionlistmonkmailing-listnewsletternewsletter-managementnewsletter-softwareself-hostedsms-gatewaysmtptransactional-emails
Parse campaign UUID in SendGrid webhook. Closes #1177.
Kailash Nadhda377d83e6f8
diff --git a/internal/bounce/webhooks/sendgrid.go b/internal/bounce/webhooks/sendgrid.goindex ec32dcdc..c62ab413 100644--- a/internal/bounce/webhooks/sendgrid.go+++ b/internal/bounce/webhooks/sendgrid.go@@ -20,6 +20,10 @@ type sendgridNotif struct {Email string `json:"email"`Timestamp int64 `json:"timestamp"`Event string `json:"event"`++ // SendGrid flattens all X-headers and adds them to the bounce+ // event notification.+ CampaignUUID string `json:"XListmonkCampaign"`}// Sendgrid handles Sendgrid/SNS webhook notifications including confirming SNS topic subscription@@ -62,14 +66,15 @@ func (s *Sendgrid) ProcessBounce(sig, timestamp string, b []byte) ([]models.Boun}tstamp := time.Unix(n.Timestamp, 0)- b := models.Bounce{- Email: strings.ToLower(n.Email),- Type: models.BounceTypeHard,- Meta: json.RawMessage(b),- Source: "sendgrid",- CreatedAt: tstamp,+ bn := models.Bounce{+ CampaignUUID: n.CampaignUUID,+ Email: strings.ToLower(n.Email),+ Type: models.BounceTypeHard,+ Meta: json.RawMessage(b),+ Source: "sendgrid",+ CreatedAt: tstamp,}- out = append(out, b)+ out = append(out, bn)}return out, nil