Closed (won't fix)
Project:
Mailchimp
Version:
6.x-2.6
Component:
General
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2011 at 12:42 UTC
Updated:
28 Jun 2016 at 16:32 UTC
Jump to comment: Most recent
Comments
Comment #1
cduwe commentedI've got roughly the same setup. When a new user registers to the site they've filled out the content profile details but MailChimp module tries to subscribe the new user before the content profile is actually created so the subscription fails because the tokens aren't valid yet. Any ideas on how to adjust the order of execution there?
Comment #2
levelos commentedThis should be taken care of via #998862: Increase system weight of mailchimp module. If this was a new install, I just committed an update so the system weight is also updated then.
Comment #3
cduwe commentedYeah, I thought of that so I edited the value of MC and reinstalled but it doesn't seem to have an effect. I spent a bunch of time trying to troubleshoot this and my original theory doesn't seem to be correct; I think the content profile data is there but for some reason MC isn't able to access it.
I was trying to make the MC newsletter "required." Since that wasn't working but manually subscribing/unsubscribing was I made a custom rule for the rules module trying to figure out a solution for the client and when that rule ran it couldn't get the content profile token data either.
In the end, I just updated the message the system sends the admin to ask them to approve a new user on the site with, "and don't forget to go here (link to MC subscription page) and subscribe this new user to the newsletter."
Comment #4
SMerriman commentedSame problem here. Using content_profile fields as merge tags aren't working on registration. From what I can tell, this is because the content_profile creation occurs after the user is created (and has to, so that it can connect it to the user id), but the mailchimp subscription happens when the user is created in hook_user('insert') (and thus before any other submit hooks into the registration form).
I believe this could be fixed by moving the code from hook_user into a custom submit hook for the user register form - this would then be run after content_profile and everything else. Any issues with that?
Comment #5
SMerriman commentedActually, that's not the cause; I think this is more of a bug inside the content profile module. For anyone else interested - when the user tokens are generated, content_profile_load is called and is empty. The empty value then gets cached for the remainder of the page load, meaning when it becomes time to find the real tokens, the content isn't being loaded. My hacked solution for now is to hook in and call content_profile_load with the reset parameter = TRUE before mailchimp calculates the merge variables, but this should probably be changed in the content_profile module, not here.
Comment #6
langworthy commentedCan you explain #5 more clearly?
As I understand it content_profile creates the user tokens. As explained in #4 the profile node is created during a submit function. Since mailchimp subscribes users during hook_user('insert') the subscription will always happen before the user is created and therefore before the profile is created. mailchimp.module will never have an opportunity to get the merge variables from the profile.
Maybe I'm missing something?
Comment #7
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!”