From 43c0604ac605a082ca3631c9ef2f2e75378e15a3 Mon Sep 17 00:00:00 2001 From: Will Estes Date: Thu, 23 Jul 2026 21:54:30 -0400 Subject: [PATCH] Always send messenger=email in campaign payloads Discovered while verifying the TestCampaign fix against real listmonk: create/update apparently default an omitted messenger to "email" server-side, but the test-send endpoint validates the raw request body without that same defaulting, failing with "Unknown messenger .". eec-campaigns only ever targets email, so send it explicitly instead of depending on an inconsistency between endpoints. Co-Authored-By: Claude Sonnet 5 --- internal/listmonk/listmonk.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/listmonk/listmonk.go b/internal/listmonk/listmonk.go index 6325565..8387a14 100644 --- a/internal/listmonk/listmonk.go +++ b/internal/listmonk/listmonk.go @@ -336,6 +336,12 @@ func (in CampaignInput) payload() map[string]any { "content_type": "markdown", "body": in.Body, "type": in.Type, + // listmonk's create/update handlers default an omitted messenger to + // "email" before validating, but the test-send handler validates the + // raw request body as-is — an omitted messenger there fails with + // "Unknown messenger .". eec-campaigns only ever sends email, so set + // it explicitly everywhere rather than relying on that asymmetry. + "messenger": "email", } if in.FromEmail != "" { p["from_email"] = in.FromEmail