Reputation: 3986
I am running the following code (I've hidden ID's) to update a subscriber's email address in a MailChimp list:
$mailchimp->patch('lists/1234567/members/' . md5('[email protected]'), [
'email_address' => '[email protected]',
'status' => 'subscribed',
'merge_fields' => array(
'FNAME' => 'Ben',
'LNAME' => 'Sinclair',
),
]);
It does not seem to work. I do not receive any errors, it just does nothing.
How do you update an email address in a MailChimp list using API V3?
Upvotes: 1
Views: 5654
Reputation: 11
You can change the email address when you make the request
PUT https://usx.api.mailchimp.com/3.0/lists/{list_id}/members/{subscriber_hash}
and the body was this:
{"email_address": "[email protected]"}
$List = 123456;
$subscriber_hash = md5("[email protected]")
$data = array('email_address' => "[email protected]" );
$result = $mailchimp->put("lists/$List/members/$subscriber_hash", $data);
Upvotes: 1
Reputation: 176
Currently, the email address is a parameter (read only = false) in the PUT method (.../3.0/lists/{listId}/members/{md5}) that allows to change the email address of the subscriber.
I'm sending the new email in the body and MERGE0 (EMAIL) tag but using the md5 from the previous email. It is changing the email correctly.
Upvotes: 1