1. Fabrik 3.8.1 has been released. It is mostly bug fixes and feature enhancements, but does include two new plugins (push notifications, and the sequence element). As usual we strongly recommend testing the new release on a sandbox if your application is mission critical, and always do an Akeeba backup before updating.
    Dismiss Notice

MailChimp revisited

Discussion in 'Standard Support' started by JackGoa, May 15, 2018.

  1. JackGoa

    JackGoa Member

    Level: Community
    Hey guys, I really, really need that MailChimp plugin updated to the latest MailChimp API so I can integrate it properly with my websites.

    What do I need to do to get a price from someone to do this? Just please tell me what to do. The longer I'm putting it off now, the more urgent it is becoming.

    I've asked a few times now, but it always just ends up disappearing into the ether.

    Please help!!?? :(
     
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I committed updates to the Mailchimp plugin for the new API a few months ago, with support for the new 'interests' stuff. It's deployed on a couple of our direct client sites, working fine.

    https://github.com/Fabrik/fabrik/tree/master/plugins/fabrik_form/mailchimp

    I also added a new feature a few days ago to optionally use a checkbox on your form instead of the one added by the plugin to the bottom of the form.

    I would have let you know, but I couldn't remember who it was had been asking me about it.

    -- hugh
     
  3. JackGoa

    JackGoa Member

    Level: Community
    Whaaa!!?? Awesome!! Thanks so much Hugh!

    I'd like to donate or do something towards it. What to do?

    After all I did also request it and to show appreciation.
     
  4. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Take out a paid sub for a month.

    -- hugh
     
    JackGoa likes this.
  5. JackGoa

    JackGoa Member

    Level: Community
    Adding to budget for month end.

    Thanks!
     
  6. JackGoa

    JackGoa Member

    Level: Community
    Ok sorry, I'm going to ask stupid questions now.

    How do I download that plugin, or is it already included in the new Fabrik releases?
    If not, can I just overwrite my old plugin after downloading it?
     
  7. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Do a full github update. See the wiki if you haven't done one before.

    -- hugh
     
    JackGoa likes this.
  8. JackGoa

    JackGoa Member

    Level: Community
    Thanks.
     
  9. JackGoa

    JackGoa Member

    Level: Community
    First off, I forgot to take out that sub! Doing it right now.

    I only realised now, none of my sites where I use this plugin updates the Groups section in MailChimp since the update. Is there any way to fix this? That said, how hard is it to add the functionality to update/change more than one group?

    See attached file to see what I am referring to.

    I use this feature quite extensively to update users and emails are sent out based on the groups they join.
     
  10. JackGoa

    JackGoa Member

    Level: Community
    Would it be possible for a moderator to move this thread to the Standard Support forum?
     
  11. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    That JSON doesn't look right - that looks like the old groups format with the group name, not the new Interests format. Interests should be an ID that look something like this:

    [{"58d1ec4981":true}]

    As per the tooltip, you have to get the Interest ID from their API "playground". It's ridiculously difficult, they don't provide an easy way to find out the ID. Here's a Stack Exchange discussion on the topic:

    https://stackoverflow.com/questions...chimp-interest-group-id-without-using-the-api

    And here's a little screencast showing you where I got the id for the example above.

    https://www.screencast.com/t/rEhkavrM

    Another wrinkle is that if you have more than 10 lists, the Playground UI only shows you the first 10 and no obvious way to paginate. I managed to work round that on another account, but I can't exactly remember how.

    It really is insane that they don't make that ID visible anywhere in the dashboard, and if you Google the subject, you'll find it's been an issue many people have complained about since v3 was introduced.

    -- hugh
     
  12. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    At some point I may get froggy and add a special JForm field type to grab the interests and groups through the API (using the key specified in the settings), so I can provide a dropdown of available ID's, with their coresponding names, so you can just pick from a list. But that's a couple of hours coding, which I can't justify until there's a significant number of people subscribing to use this code.

    -- hugh
     
  13. JackGoa

    JackGoa Member

    Level: Community
    Ah sherbet Hugh, sorry forgot to add I did figure that part out. Yes, they sure did not make it easy. And I do have a few lists.

    I see you use the square brackets in your example, I did not use it and it still works. Is it important?

    Please do feel froggy! Look, I'll even make a plan and subscribe to Standard Support for a few more months if that is what it would take to make this plugin fully integrated and awesome?

    My question now relates more to the update part. For instance, on my one list I send new subscribers back to another form where I ask them various questions. Due to only being able to update one group/interest thingy, up until now I would go in once a week and update new subscribers manually, one by one with all the interests they ticked.
    Is it possible now to update to Mailchimp all the interests (about 4 or 5 different groups with 3-5 interests per group) they ticked? If yes, how would the format for that look?
     
  14. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    As per the tooltip, you can add as many interest ID's as you want, and use element placeholders to set the values. The way the new interests work is that they are either 0 or 1 (or true or false). And as the tooltip says, "is the value of the placeholder is anything but empty or 0, the interest will be selected".

    So, for example, to set two interests, one always set, and the other dependent on an element ...

    [{"58d1ec4981":true,"67fg848c746":"{yourtable___yourelement}"}]

    So say yourtable___yourelement is a checkbox, with values of 0 and 1, a selection of 1 will enable that interest, 0 will disable. And it should work in edit mode, ie. if they've already submitted the form, then edit and submit again, unselecting 'yourelement', they will be removed from that interest.

    Note that you'll probably need to append _raw, as usual with placeholders for elements with "value" and "label", so get the value.

    -- hugh
     
  15. JackGoa

    JackGoa Member

    Level: Community
    Awesome!

    So just to be clear, for a checkbox, which has "value" for the checkobox, I would append _raw?

    If a client updates a MailChimp form, would it update back to Fabrik?
     
  16. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Yes. And to re-iterate, a value of 0 or an empty string is "false", anything else is "true". So 1, Yes, 321, Some Random Text, etc are all "true". Only 0 or nothing are "false".

    Nope. It's a one way thing, updating MailChimp from a Fabrik form submission.

    -- hugh
     
  17. JackGoa

    JackGoa Member

    Level: Community
    Cool, thanks! This is going to make my life so much easier!
     
  18. JackGoa

    JackGoa Member

    Level: Community
    In the case of a radio button, do I have to update the ID for each interest, or can I set it to only update the group ID and it will know which option was selected?
     
  19. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Not sure what you mean.

    As mentioned above, a value of 0 is "false" for a given interest, anything else is "true". So if your "Group 1" interest is ID 1234567, and you have a radio button "group1" for "Yes" or "No" (values 0 and 1) to sub to that group ...

    [{"1234567":"{yourtable___group1_raw}"}]

    Are you trying to combine multiple interests into a single radio button? Like a radio for "Group 1" or "Group 2" or "Group 3"?

    If so, I haven't tried it, but this might work:

    Set the value of the radio selections to the interest ID, so "Group 1" is "1234567", and ...

    ["{yourtable___group1_raw}":"1"}]

    Note however that this wouldn't un-sub them from the other group(s). So if they submitted with Group 1, then edited the form and re-submitted with Group 2, they would then wind up sub'ed to both.

    -- hugh
     
  20. JackGoa

    JackGoa Member

    Level: Community
    I have 4 groups. 3 of them each have 3 radio button options, the 4th group is a bunch of checkboxes.

    So how I have it now is, I have the ID for each Interest (not group) and I have them all setup like this:
    [{"479879853":"{yourtable___group1_raw}"}]
    (for the radio buttons I did not use _raw, only the checkbox ID's has the _raw part)
     

Share This Page