Can't configure MailChimp to add to list upon PayPal purchase

I can see it’s working for other people on here, so assume it’s me and my error… but I cannot get his working for me.

I have s2member Pro. I have PayPal Pro, although I’m just testing with a PayPal button for starters here. I have MailChimp set up.

I have added MailChimp API to s2Member. I have created a new list on MailChimp and added the ID to the Level #1 Members field.

I have created the ‘s2-hacks.php’ file (https://s2member.com/kb-article/can-i-add-custom-mail-merge-fields/) and edited my MailChimp list to reflect the additional fields, including those that are visible or not. However, I have not made any edits to this s2-hacks.php file as I can’t see what needs to be edited… is this where I am going wrong? The file comments mention variables that aren’t present (or are they elsewhere?)

Also, another thing I am wondering - if the name not getting added to the MailChimp list because it is an existing user (n the website, NOT in the MC list)?

Some (any) assistance/pointers would be most welcome.

Thanks.

Andy

If your Custom Fields are different than the ones in the hack file, those will need to be changed:

$custom_fields = array_merge($custom_fields, array(
        'ROLE'    => $args->role,
        'LEVEL'   => $args->level,
        'CCAPS'   => $args->ccaps,
        'LOGIN'   => $args->login,
        'USER_ID' => $args->user_id,

If you are using a Billing Modification button and not a registration button the User should still be added to MailChimp. You should never use a registration button for an existing User, but I’m not sure about how that would affect the MailChimp signup. It might or it might not.

Hi Jedi Shark: thanks for the reply.

I copied the set-up in the image below (on the KB article page) so yes they are the same. So at least I now know that bit is set up okay?

For the button - it was just a regular PayPal button for Level #1. When a customer buys the product, this should trigger their name to be added to the new MailChimp list irrespective of whether they already have a user account on the website or not. I’m assuming that’s correct (I’m not updating any billing or such like)?

Maybe you also set “double opt-in”? In this case user will get a confirmation message from MC, and will join the list if confirms.

Also maybe this plugin of mine can help you.

1 Like

Thanks for the help Pat and Krum… I had to pause this for a bit, but have now re-thought and decided to drop MailChimp altogether… so have managed to skirt this problem. This thread can now be closed. Cheers