Hi there,
thank you for your quick reply. I tried the solution in the code snippet but I come across a problem.
My interest field looks like this in the form:
<input type="hidden" name="INTERESTS[761fe95add]" value="Summer project">
And the snippet like this:
add_filter( 'mc4wp_integration_ninja-forms_subscriber_data', function(MC4WP_MailChimp_Subscriber $subscriber, $form_id) {
if ($form_id == 3) {
$subscriber->interests['761fe95add'] = true;
}
return $subscriber;
}, 10, 2);
When I tried to subscribe from the form I receive this error:
[2021-06-09 15:37:39] ERROR: Ninja Forms > Mailchimp API Error: Bad Request. Invalid Resource. Invalid interest ID: '761fe95add'.
Request:
POST https://us6.api.mailchimp.com/3.0/lists/**********/members
{"status":"pending","email_address":"name.***+TEST@gm***.com","interests":{"761fe95add":true},"merge_fields":{"MMERGE1":"Name"},"email_type":"html","ip_signup":"95.90.***.***","tags":[]}
Response:
400 Bad Request
{"type":"https://mailchimp.com/developer/marketing/docs/errors/","title":"Invalid Resource","status":400,"detail":"Invalid interest ID: '761fe95add'.","instance":"722e0f6f-31b0-****-94cd-************"}
Am I using the wrong ID? Where should I get the correct one?
Thanks a lot for your help,
Simone