My form is sending an array of IDs to my create function. FireBug shows this as:
No matter what I try, I keep getting a 400 error with Invalid ListIds.
If I hardcode it like the following it's ok:
'ListIDs' => array('5cb76bb2fc5f08c71d1c7793b56232','a746b21b1941ef9d43854ff2e784ea23'),
But none of the following work. Please help!?
'ListIDs' => array($postData['listids']); // won't work as it's an array inside an array
'ListIDs' => array(json_encode($postData['listids']));
'ListIDs' => array(implode(",", $postData['listids']));
I've tried putting my id's in quotes:
$this->listids->addMultiOption ( "'" . $list->ListID . "'", $list->Name);
Firebug now shows:
I'm then imploding them:
$lists = implode(",", $postData['listids']);
But the following still doesn't work: 'ListIDs' => array($lists),
Worked it out. More a PHP/Zend issue than anything else - am my ineptitude of course...
$listString = $postData['listids'];
$lists = explode(",", $listString );
'ListIDs' => $lists
From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.Get started for free