Fix TestCampaign sending only subscribers, failing listmonk validation
CI / test (push) Successful in 9s
CI / test (push) Successful in 9s
listmonk's /api/campaigns/:id/test handler binds the request into the
same campReq struct create/update use and validates it in full, so a
request with only {"subscribers": [...]} fails with "Invalid length
for name" before subscribers is ever read. TestCampaign now sends the
campaign's full CampaignInput alongside subscribers.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -137,7 +137,7 @@ func syncOne(lm *listmonk.Client, slug, dir, path string, defaultPreviewEmails [
|
||||
}
|
||||
var previewErr error
|
||||
if len(recipients) > 0 {
|
||||
previewErr = lm.TestCampaign(campaignID, recipients)
|
||||
previewErr = lm.TestCampaign(campaignID, input, recipients)
|
||||
}
|
||||
return syncOneResult{Changed: true, PreviewErr: previewErr}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user