Everything is working great, but I'd like to also pass the variable "Checked" or "On" through the call to activate the function of "Add an opt-in checkbox for other lists", just as the form builder allows me to do.
I've tried this, and it passes everything except my last variable.
It looks like you're attempting to use Subscriber.AddWithCustomFields to subscribe an individual to more than one list, however that's not the purpose of that procedure. If you want to use the API to subscribe to more than one list, you'll need to make a call to the API for each list they'd like to be a member of.
For example (this example assumes that the custom fields from the first list DON'T apply in the third but DO apply in the second)
mibrenenr
New member
1 Posts
Hello,
I'm using the http://www.campaignmonitor.com/api/kits/#php-sample to add people to my mailing list(s), including the function Subscriber.AddWithCustomFields.
Everything is working great, but I'd like to also pass the variable "Checked" or "On" through the call to activate the function of "Add an opt-in checkbox for other lists", just as the form builder allows me to do.
I've tried this, and it passes everything except my last variable.
Code:
$cm->subscriberAddWithCustomFields('fake@email.com', 'John Doe', array('Phone'=>'(123) 123-1234', 'Company' => 'ABC Widgets', 'Other List' => 'On'));Does anyone know how to do this?
Posted 3 months ago
Phil
Campaign Monitor
37 Posts
Hi mibrenenr,
It looks like you're attempting to use Subscriber.AddWithCustomFields to subscribe an individual to more than one list, however that's not the purpose of that procedure. If you want to use the API to subscribe to more than one list, you'll need to make a call to the API for each list they'd like to be a member of.
For example (this example assumes that the custom fields from the first list DON'T apply in the third but DO apply in the second)
Code:
$cm->subscriberAddWithCustomFields('fake@email.com', 'John Doe', $customFieldsArray, $listID_1); $cm->subscriberAddWithCustomFields('fake@email.com', 'John Doe', $customFieldsArray, $listID_2); $cm->subscriberAdd('fake@email.com', 'John Doe', $listID_3);Hope that helps.
Posted 3 months ago