I am trying to use the MailChimp API to update a member's email address when they change their email address in our web application.
I use the Laravel MailChimp kit and it works fine (I can subscribe to users, update groups, update name, etc.), but I must have merge_vars or something wrong.
I use this:
$member_details = array( // grabbed from config and working (also API key handled by bundle) 'id' => $id, // passed from function - corresponds to the old email address 'email_address' => $mailchimp_old_email, 'merge_vars' => array( // Old email again? 'EMAIL' => $mailchimp_old_email, // new email address 'NEW-EMAIL' => $mailchimp_new_email, ), 'replace_interests' => FALSE, ); $response = Mailchimp::listUpdateMember($member_details);
So, "$ response = 1", which made me think that it worked, but the user email address did not change when I look at the list of subscribers in MailChimp.
The API 1.3 docs have a listSubscribe detailing the merge_vars "EMAIL" and "NEW-EMAIL" in detail , and I read about it on https://stackoverflow.com/a/168257/ ... I tried again using listSubscribe, even if it was an existing member, but that failed with the answer $ in which the user has already subscribed.
Any recommendations on where I might be wrong? I have not found a clear example of this kind of use of the api listUpdateMember api.
source share