by Fanatical Labs

Save Your Team Countless Hours. SugarChimp syncs your lists in both directions so that you can work in your preferred application. Segment and Group your MailChimp subscribers based on SugarCRM data so you can market to the right people at the right time. Fully compatible with all versions and editions of Sugar and SuiteCRM.

Cancel at any time!
Free Trial

#4214 - MailChimp Webhooks - how do they work?

Closed General Question created by JohnK a year ago

Our IP whitelist was blocking webhook traffic from MailChimp (you have to check for this regularly - the webhook IP addresses change frequently).

Accordingly, I've written a tool to re-fire webhooks to SugarChimp. But clearly firing lots of data - that may be obsolete - to SugarChimp could cause problems: people may have re-subscribed to lists they'd unsubscribed from in the meantime, people may have already opted out of a list.

I have the following questions:

  1. How does SugarChimp look up a SugarCRM contact from the data provided in the webhook?
  2. How does SugarChimp look up a Target List from the data provided in the webhook?
  1. JohnK member avatar

    JohnK

    a year ago

    Additionally, it's really unclear which information is needed for which webhooks.

    The MailChimp webhook support contains the following: https://developer.mailchimp.com/documentation/mailchimp/guides/about-webhooks/

    "type": "unsubscribe",
    "fired_at": "2009-03-26 21:40:57",
    "data[action]": "unsub",
    "data[reason]": "manual",
    "data[id]": "8a25ff1d98",
    "data[list_id]": "a6b5da1054",
    "data[email]": "api+unsub@mailchimp.com",
    "data[email_type]": "html",
    "data[merges][EMAIL]": "api+unsub@mailchimp.com",
    "data[merges][FNAME]": "Mailchimp",
    "data[merges][LNAME]": "API",
    "data[merges][INTERESTS]": "Group1,Group2",
    "data[ip_opt]": "10.20.10.30",
    "data[campaign_id]": "cb398d21d2",
    "data[reason]": "hard"

    But of these fields, which are the ones necessary to process an unsubscribe? E.g., are the merge fields actually used?

  2. fanaticallabs member avatar

    Fanatical Labs Provider Affiliate

    a year ago

    Hello John,

    These are all great questions. I'm happy to answer them for you:

    1. How does SugarChimp look up a SugarCRM contact from the data provided in the webhook?

    -We use the email address to match records between the two systems because email addresses on a Mailchimp Audience are unique.

    1. How does SugarChimp look up a Target List from the data provided in the webhook?

    -We add a 'mailchimp_list_name_c' field to the Target List module which is populated with a Mailchimp List id whenever a Target List is synced to a Mailchimp List. We use the list_id from the mailchimp webhook to see if that list is synced to a Sugar a Target List.

    1. Which data is used in Sugar, specifically for unsubscribe calls:

    It would be safest to send across all of the data from the webhooks, but you can scrub some information based on the type of webhook. For unsubscribes, we only need:
    -type
    -fired_at
    -data[action]
    -data[reason]
    -data[list_id]
    -data[email] (not sure which email we use here so just keep both for safety)
    -data[merges][EMAIL]
    -data[campaign_id]

    I hope this gives you a clearer picture of what we need. Let me know if you have any more questions on this.

    Kind Regards,
    Jon

  3. fanaticallabs member avatar

    Fanatical Labs Provider Affiliate

    a year ago

    Hello there,

    We haven't heard from you regarding the issue in a few days. Is there anything we can help with?

    Let me know how I can help.

    Thanks,
    Jon
    Fanatical Labs Support

  4. JohnK member avatar

    JohnK

    a year ago

    Thanks for the response fanatical labs!

    Yes, please can you tell me the following:

    1. You mention that you use the email address to look up the contact. What happens if there are duplicate contacts with the same email address? How does SugarChimp decide which contact the unsubscribe belongs to? Or does it unsubscribe both?

    Thanks,

  5. fanaticallabs member avatar

    Fanatical Labs Provider Affiliate

    a year ago

    Hello John,

    The 'opted out' flag in Sugar actually lives at the email address field, so when a record is marked as opted out in Sugar, it will actually opt out the email address, which makes everyone with that email show as opted out in SugarCRM.

    Our default behavior is to mark the record as opted out, which will follow the behavior described. However, we have some different ways of handling Mailchimp unsubscribes using our globaloptout configuration options. If you would like to take a look at those, you can see them here: https://fanaticallabs.zendesk.com/hc/en-us/articles/360021151672-Advanced-Configuration-Settings

    Let me know if you have any more questions on that.

    Kind Regards,
    Jon

  6. fanaticallabs member avatar

    Fanatical Labs Provider Affiliate

    a year ago

    Hello there,

    We haven't heard from you regarding the issue in a few days. Is there anything we can help with?

    Let me know how I can help.

    Thanks,
    Jon
    Fanatical Labs Support

This case is public. Please leave out any sensitive information such as URLs, passwords, etc.
Saving Comment Saving Comment...
Rating
Rating

Keep up to date on the latest additions

We'll send you an email every month with handpicked add-ons, reviews, tricks and tips. Don't worry, we hate spam as much as you do.