Closed (won't fix)
Project:
Mailchimp
Version:
7.x-2.7
Component:
Lists
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Nov 2012 at 21:54 UTC
Updated:
21 Mar 2017 at 00:58 UTC
Jump to comment: Most recent
Comments
Comment #1
jsibley commentedThis dates from November 2012 and has had no response at all.
It would be helpful to make available to views a way to show whether a user is subscribed to a list.
As of now, I don't see anything from mailchimp to create a relationship from a user view.
Is this information stored within Drupal at all or is it only available through API calls?
Comment #2
mstrelan commentedAs far as I can tell this is because the subscription data is not actually stored in the field data table, but stored in the cache_mailchimp table. The relevant cid would be
[listid]-[user:mail], but you can't really query the cached data, only the presence of the cache entry. An alternative would be to use a computed field or manually sync to a hidden field in a custom module and filter on that.Comment #3
michaellenahan commentedFollowing up from @mstrelan's comment, here's what I did to solve this in my case.
In my case, I have two fields on the user profile: a mailchimp subscription field (field_profile_mailchimp) and an ordinary Drupal drop-down yes/no field (field_profile_newsletter).
I use hook_mailchimp_process_webhook() to update this field whenever the user unsubscribes using the mailchimp unsubscribe link.
In the profile itself, we:
- Detect if the mailchimp field has changed, and update the drupal field accordingly
- Hide the actual mailchimp subscription field
Comment #4
jlarrubia commentedI had the same problem. Solution in #3 is good but not consider every case. People can be suscribed/unsuscribed using different ways, not only your Drupal website or the unsuscribe link.
Following up #3, I solved in this way:
1. Configuring my webhook (admin Mailchimp) to send updates when a change is made:
- by a subscriber
- by an account admin
- via the API
So, I can be sure any change in my list will be notified.
2. Modifying the mailchimp_process_webhook:
3. Hiding the ordinary Drupal drop-down yes/no field ('field_profile_newsletter'). If a user changes his suscription by the form of the mailchimp field ('field_profile_mailchimp'), the field 'field_profile_newsletter' will be updated by the previous hook (step 2).
4. hook_form_profile2_form_alter is not necessary
If you have several lists, you should check the list which fired the webhook and change the corresponding field.
Comment #5
amytswan commented“And now our watch [for support of the 7.x-2.x version of the MailChimp module] has ended…” With the approaching deprecation of MailChimp’s API version 2.0, I’m sad to say we too must turn the page. This branch will become unsupported in early October and officially deprecated by the end of this year (2016).
Fret not! The 7.x-4.x and 8.x versions come highly recommended. Both are using Mailchimp’s new API 3.0 and are being actively maintained. If you find this issue still exists on either the 7.x-4.x or 8.x branches, let us know by opening a new ticket. “What is dead may never die, but rises again, harder and stronger!”
Comment #6
Marja Kuijsten commentedLooking for this to work with 7.x-4.x!