1 Commits

Author SHA1 Message Date
will 43c0604ac6 Always send messenger=email in campaign payloads
CI / test (push) Successful in 8s
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 <noreply@anthropic.com>
2026-07-23 21:54:30 -04:00
+6
View File
@@ -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