The ADDRESS is a Merge Field but the documentation (http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/) is not clear on how to pass it to the API, since it has sub fields for street, zip, city etc. Does anybody have an example how to do this?
Click the Manage Audience drop-down and choose Add a subscriber. Type in the subscriber's information and check the This person gave me permission to email them box. Apply any necessary tags. If you have groups set up in your audience, those options will appear here.
To add a contact to an audience, you must include the subscription status in your payload: Use subscribed to immediately add a contact. Use pending to send a confirmation email. Once confirmed, the contact's status will update to subscribed .
The Mailchimp Marketing API provides programmatic access to Mailchimp data and functionality, allowing developers to build custom features to do things like sync email activity and campaign analytics with their database, manage audiences and campaigns, and more. To use the Marketing API, you need a Mailchimp account.
It works for me (php)
$address = new stdClass();
$address->addr1 = $customer->address;
$address->city = $customer->city;
$address->state = $customer->state;
$address->zip = $customer->zip;
$address->country = $customer->country;
$options = [
'status' => 'subscribed',
'email_address' => $customer->email,
'merge_fields' => [
'FNAME'=> $customer->first_name,
'LNAME'=> $customer->last_name,
'PHONE' => $customer->phone,
'ADDRESS' => $address,
]
];
...
curl_setopt($ch, CURLOPT_POSTFIELDS,json_encode($options));
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With