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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user