veda-consulting-company / uk.co.vedaconsulting.mailchimp

Other
22 stars 43 forks source link

Contact Unsubscribed in Mailchimp instead of removed from Mailchimp group #213

Closed cmmadmin closed 7 years ago

cmmadmin commented 8 years ago

When a contact is removed from a group in CiviCRM, the contact is Unsubscribed in Mailchimp instead of removed from the Interest Group as we would expect.

Here's what I did: 1) In mailchimp I created a list 'Sync Test' and 2 groups within it 'Ministry A Newsletter' and 'Ministry A Webinar' both contained within a grouping called 'Ministry A'.

Then in CiviCRM: 2) I created two groups: 'Ministry A Newsletter' and 'Ministry A Webinar'. I put one contact (Ashlyn) in both groups. 3) I then used search builder to find all contacts in either of these two groups and used the results to create a smart group called 'Sync Test'. 4) I then changed the settings for the group 'Sync Test' to sync with the MailChimp list 'Sync Test' (using 'Sync membership of this group with membership of a Mailchimp List') 5) I then changed the settings for the 2 groups 'Ministry A Newsletter' and 'Ministry A Webinar' to point to their respective MailChimp groups (using 'Sync membership of with a Mailchimp interest grouping')

I then removed Ashlyn from the 'Ministry A Webinar' group in CiviCRM. I looked in Mailchimp and it shows the following for Ashlyn:

This person unsubscribed on May 27, 2016 3:53 pm Reason: N/A (Unsubscribed by an admin)

So, Ashlyn appears to be unsubscribed from both groups in Mailchimp instead of being removed from the 'Ministry A Webinar' group as we would expect.

Kajakaran commented 8 years ago

@cmmadmin The behaviour looks right. Let me clarify this.

In CiviCRM, You have one master and two child groups and the removed contact was in both child and master group. The same principle applies to Mailchimp as well, the removed contact was in both group and list.

so when you remove a contact from group in civicrm, it will remove that contact in list and group as well.(child can't be without parent. This applies to both civicrm and mailchimp)

Thanks Kajan

cmmadmin commented 8 years ago

Not exactly. The contact (Ashlyn) was in both child groups. I removed her from only one of them (Ministry A Webinar). So, in CiviCRM she is still in the other child group (Ministry A Newsletter) and the parent smart group (Sync Test). Since she is still in the parent smart group she should not be unsubscribed from the master list in Mailchimp.

I have reproduced this issue several times.

Kajakaran commented 8 years ago

@cmmadmin

In mailchimp list, if you unsubscribe from a group manually, it will also unsubscribe from list as well. This same logic applies when we do via api. When you remove a contact from a group in CiviCRM, we call unsubscribe api call and this api call will do the same job as if we did manually.

Thanks Kajan

cmmadmin commented 8 years ago

Since we are using Mailchimp Interest Groups it does not seem appropriate to perform and unsubscribe upon removal from a CiviCRM group. It seems more appropriate to perform a removal from the interest grouping (as it done with Update Profile in Mailchimp).

As my test case highlights, a removal from a child group should not result in a unsubscribe from the parent list when the contact exists in another child group.

Is this a change that could be considered for the plugin. It appears to be a serious issue for users that are using Interest Groups.

Kajakaran commented 8 years ago

@cmmadmin

The assumption of current extension is any contact in a group (child group) should also be in membership group(parent group) in CiviCRM. So in you case, you are removing a contact from one child group. You have to remove this contact from membership group as well(parent group).

In future release, this logic could be changed by using newer api https://github.com/veda-consulting/uk.co.vedaconsulting.mailchimp/issues/214

Thanks Kajan

jtbayly commented 8 years ago

I'm not able to follow the logic perfectly here, but it sounds to me like the end result of this is that you can have contacts that are not in sync between Mailchimp and CiviCRM. Is that correct?

If so, I'd like to get a clearer picture on when this can happen.

cmmadmin commented 8 years ago

Yes, that is correct. The end effect is they are not in sync. The contact (Ashlyn in my example) remains in one group in Civi but has been unsubscribed entirely from the list in Mailchimp.

To reproduce this you can:

  1. Create two groups in Civi (e.g., 'Ministry A Newsletter' and 'Ministry A Webinar').
  2. Create a smart group in Civi that contains all contacts in those two groups (e.g., 'Sync Test').
  3. Create a list in Mailchimp (e.g., 'Sync Test').
  4. In Mailchimp, create two interest groups in the Sync Test list (e.g., 'Ministry A Newsletter' and 'Ministry A Webinar').
  5. Setup the list (Sync Test) to sync using 'Sync membership of this group with membership of a Mailchimp List'.
  6. Setup the groups (Ministry A Newsletter and Ministry A Webinar) to sync using 'Sync membership of with a Mailchimp interest grouping'
  7. Add a contact to both groups in Civi.
  8. Verify the contact now appears in both interest groups in Mailchimp.
  9. Remove the contact from one group in Civi.
  10. You will notice the contact is now unsubscribed from the list in Mailchimp, but is still in the other group in Civi.
artfulrobot commented 8 years ago

I can confirm that this problem no longer exists in my coming-soon v2.0. Pls follow #214