Closed (won't fix)
Project:
Mailchimp
Version:
6.x-2.x-dev
Component:
General
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Apr 2011 at 00:41 UTC
Updated:
28 Jun 2016 at 16:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
xurizaemonThis patch to mailchimp.module makes two changes -
1) mailchimp_user() loads the required lists against the user in hook_user(). It maintains the existing behaviour of setting lists according to the assigned roles.
2) mailchimp_cron() checks $account->mailchimp_lists instead of $account->roles.
(array_intersect_key() is PHP5, if mailchimp doesn't already require php5 I can provide an alternative).
By utilising the user object, we allow other modules to interact with the user's subscribed lists in hook_user(), and we can do things like this.
The above code is part of an external module for a site which uses content_profile, and has fields "content_profile_a" and "content_profile_b".
Having "Y" for either of these fields means the site user should be included in required list subscriptions; otherwise they are unsubscribed.
We set those lists to "required" for 'authenticated user' role, then decide based on properties of the user (or their profile) whether the user will be subscribed or not.
Comment #2
nrackleff commented“And now our watch [for support of the 6.x version of the MailChimp module] has ended…” With the end of Drupal 6 support, I’m sad to say we too must turn the page.
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. “What is dead may never die, but rises again, harder and stronger!”