custom fields not loading

I am posting a new subscriber using the csrest_subscribers wrapper.  In my testing, I have been able to insert a new subscriber's email and name but I cannot insert values into the 'State' custom field I created for that list.  Here's the relevant code:


require_once '../../csrest_subscribers.php';

$wrap = new CS_REST_Subscribers('xxxxxxxxxxxxxxx', 'xxxxxxxxxxxxxx');
$result = $wrap->add(array(
    'EmailAddress' => 'xxxxxxxxxx@gmail.com',
    'Name' => 'xxxxx',
    'CustomFields' => array(
        array(
            'Key' => 'State',
            'Value' => 'VA'
        )
    ),
    'Resubscribe' => true
));

i've xed out the API keys and identifiable data for presentation but these are correct and working. 

Does anyone know what might be the problem here?

Many thanks for any help

Phil

terryt terryt, 3 years ago

Hi Phil,

You actually want to pass "Virginia" instead of "VA".  Hope that helps!

Terry


Terry Tice
Campaign Monitor

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098