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:
@@ -39,5 +39,5 @@ func Test(lm *listmonk.Client, slug string, emails []string) error {
|
||||
if camp == nil {
|
||||
return fmt.Errorf("no campaign named %q in listmonk — run sync first", slug)
|
||||
}
|
||||
return lm.TestCampaign(camp.ID, emails)
|
||||
return lm.TestCampaign(camp.ID, camp.AsInput(), emails)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user