pmpro-mailchimp icon indicating copy to clipboard operation
pmpro-mailchimp copied to clipboard

New Subscribers Aren't Being Added After Checkout

Open JarrydLong opened this issue 4 years ago • 3 comments

Plugins activated during testing:

  • Paid Memberships Pro 2.2.6
  • Paid Memberships Pro - Mailchimp Add-on 2.2.1
  • Register Helper 1.5

Steps to Reproduce

  • Fill out API key in settings page and select lists. No double opt-in.
  • Run through the normal process of checkout out - check the checkbox to be added to the list.
  • Checkout runs through smoothly. You don't get added to your MC list though.

I've dug a little further, the response we get from Mailchimp after sending the data through comes with this:

{"new_members":[],"updated_members":[],"errors":[{"email_address":"[email protected]","error":"Your merge fields were invalid.","error_code":"ERROR_GENERIC"}],"total_created":0,"total_updated":0,"error_count":1,"_links":[{"rel":"self","href":"https://us5.api.mailchimp.com/3.0/lists/5da3fc1169","method":"GET","targetSchema":"https://us5.api.mailchimp.com/schema/3.0/Definitions/Lists/Response.json"},{"rel":"parent","href":"https://us5.api.mailchimp.com/3.0/lists","method":"GET","targetSchema":"htt'...

Member topic: https://www.paidmembershipspro.com/forums/topic/mailchimp-integration-stopped-working-2/

JarrydLong avatar Feb 27 '20 09:02 JarrydLong

After testing further - this isn't a plugin issue entirely.

In some cases, Mailchimp's First and Last name fields are set to required. The plugin however sends blank values for those.

An immediate solution is to just change those two fields in MC from Required to Not Required. Perhaps we can add a value for the FNAME and LNAME fields in the plugin too though.

JarrydLong avatar Feb 27 '20 09:02 JarrydLong

I have noticed this as well. Ill try the Fname Lname thing see what happens. Is there a way to sync the users that have not been sent to mailchimp easily after the 'fix' from mailchimp side is in place?

majerus1223 avatar Aug 10 '20 14:08 majerus1223

By default, the FNAME and LNAME merge fields should be sent to Mailchimp here: https://github.com/strangerstudios/pmpro-mailchimp/blob/49d0378880b68bceb72070ee950fc6f1e2c86279/includes/api-wrapper.php#L114-L117

Can you please ensure that this issue is still occurring? If it is, can you please also try disabling any custom code on your site that also uses the pmpro_mailchimp_listsubscribe_fields filter? If the value being filtered is ever reset to an empty array, it is possible that the FNAME and LNAME fields may be getting lost.

dparker1005 avatar Feb 17 '21 19:02 dparker1005

Closing this issue as I've tested it with Version 2.3.2 and have not been able to replicate the issue anymore.

JarrydLong avatar Dec 14 '22 12:12 JarrydLong