I am trying to update a subscriber's email address using PHP cURL and Mailchimp API v3. I based my code on this:
Updating subscribers in a list using cURL and Mailchimp API v3
But somehow I can't update the email address. I can update the other fields but not email address. This is what I have:
$data = array(
'apikey' => $mailchimp_api_key,
'email_address' => $orig_email,
//'status' => $status,
'merge_fields' => array(
'EMAIL' => $email // also used NEW-EMAIL but it didn't work either
)
);
$json_data = json_encode($data, JSON_NUMERIC_CHECK);
$url = $mailchimp_api_url.'lists/'.$mailchimp_list_id.'/members/'.md5($orig_email);
$request = 'PATCH';
$result = $this->curl_request($url, $json_data, $request); // in here is basically the cURL request based on VenomRush's question above, in the link
I'm thinking I'm doing something wrong with the data request. Can anyone point me in the right direction? Thanks.