I run the following code (I have hidden identifiers) to add / update subscriber interest groups in the MailChimp list:
$mailchimp->patch('lists/1234567/members/' . md5('test@test.com'), [
'status' => 'subscribed',
'merge_fields' => array(
'FNAME' => 'Ben',
'LNAME' => 'Sinclair',
),
'interests' => array(
'abcd1234' => true,
'defg6789' => true,
),
]);
The key interestsis what I'm having problems with.
I assumed that everything that you entered in this key will overwrite what currently exists.
This does not seem to be the case. This adds new interests, but does not remove them if the identifier is not in the array. I do not get any errors.
Does anyone know how to overwrite interest groups? Or, if this is not possible, is there a way to remove interest groups?
source
share