API 3.0 - Mailchimp Integration - Error**

Hi Cristian,

I’ve just found that for the last month, the API Mailchimp integration on my site has not been working. Anyone who attempts to join (and hence be added to my Mailchimp list) gets this error:

Warning : file_get_contents(https://us19.api.mailchimp.com/3.0/lists/c7(mylistid)/members/(************************my api key)): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in /home/customer/www/harmonicatime.com/public_html/wp-content/plugins/s2member/src/includes/externals/mailchimp/Mailchimp.php on line 65

Warning : Cannot modify header information - headers already sent by (output started at /home/customer/www/harmonicatime.com/public_html/wp-content/plugins/s2member/src/includes/externals/mailchimp/Mailchimp.php:65) in /home/customer/www/harmonicatime.com/public_html/wp-includes/pluggable.php on line 1093

I’ve just run a bunch of tests including disabling ALL other plugins except for s2member and the error remains.

I’ve looked at the php code on both lines mentioned in the error and it seems it may be something to do with a cookie… but I’m definitely no expert here.

Can you please help? My business only runs with this working!

UPDATE: I’ve been working on this with mailchimp and they determined that extra information for “interests or groups” is being sent by s2member that is causing the issue.

Quote from mailchmp support:

“My team looked into this for you, and we were able to confirm an error with the information sent over from the signup form built through s2member. It looks like we’re being sent the interest parameter as your form is trying to send us information for groups. However, no data is actually being included for these groups, which is causing the call to fail.”

I then looked at the s2member release archive and the day these problems started lines up exactly with the release of v 230808.

I’ve now rolled back to v 230530 and all is working again.

Something you included in the fix for Mailchimp groups in v 230808 is causing the issue.

Can you please take a look? I’m sure I can’t be the only one experiencing this issue.

Correction my installation is only working with mailchimp when s2member version 230504 is installed.

So that’s before the 3.0 api update was made. :crazy_face:

Has anyone had the same problem?

I haven’t used the mailchimp integration yet, but I’d like to do so soon. I hope this code can be updated to work with the new API – thanks for raising this issue!