Question, what happens if a user updates their e-mail address on Drupal? Does Mail Chimp update the e-mail address as well?

Comments

eelkeblok’s picture

I have been trying to get an answer to this same question. It looks like it works this way:
- For required lists, changes are synchronized immediately, using hook_user
- For other lists, changes are only made when saving subscriptions

Now, for the latter case I haven't investigated the code thoroughly enough yet, but it seems to me that at that point, the system will have no way to know that a user changed their email-address. It will be able to find that the user is not subscribed with their current email-address, but it will not know to also remove the old email-address. I'd say this is a serious flaw. The point is discussed briefly in this older issue: http://drupal.org/node/770528. levelos comments there that here were some issues trying to get the sync to work for other lists than required ones. I'd be interested to discuss these issues, because without this kind of integration, I'm pretty certain I'll run into issues down the line with the subscriber list getting poluted with old, unused addresses because of people changing their email-addresses.

eelkeblok’s picture

To make the discussion more concrete, in the previously linked issue, another user posts an implementation of hook_user to take care of the synchronization of the email address and I suppose that could be used for other fields too. The implementation is crude (with calls being made directly to Mailchimp instead of using the API wrapper and config variables added by this module), but the basic approach seems fine. Or am I missing something?

jerry’s picture

Component: Miscellaneous » General

What I've observed using 6.x-2.5: even required lists don't handle user E-mail address changes gracefully. The new address is added automatically, but the old one is not removed. The behavior is the same whether sync-via-cron is used or not. Has anyone else observed this?

crispinbailey’s picture

Subscribing

ericbroder’s picture

Title: Question: What happens if an user updates their e-mail addres » When user updates email in Drupal they end up with two subscriptions in MailChimp for both old and new email addresses
Category: feature » bug

I'm seeing the same results as jerry. For a required list, not using "Sync Required Lists During Cron", when a user edits their email address the new email address is added to MailChimp list and the old one is not removed. This seems like a bug, I assume we should not be emailing the user at both their new and their old addresses.

Steps to reproduce:
- Configure MailChimp module to subscribe users to a required list upon user registration.
- Create new user at user/register and confirm user is added to MailChimp list.
- Go to user/edit page and update email address.
- Expected result is that MailChimp list should update user's email address and not hold onto old email address. Instead, actual result is that new subscriber is created with new email address, and old email address is still subscribed to list as a separate entry.

My environment:
- Drupal 6.22
- MailChimp 6.x-2.5

bleedev’s picture

Status: Active » Closed (won't fix)

Currently user email addresses are only updated for "Required Lists". Unfortunately fixing this for all list would require a major architectural change. For more information please see #1226958.

jerry’s picture

Can you comment on my observation above, where I note that even for required lists, old E-mail addresses are not removed? ericbroder reported a similar observation. Perhaps correcting this for required lists only wouldn't involve the major effort described.

bleedev’s picture

Jerry - This should be resolved in the latest maintenance release: http://drupal.org/node/1291478

jerry’s picture

Thanks for the pointer; I hadn't noticed yesterday's release. I just re-tested after updating the module, and while it removed the old address properly when cron updates were disabled, it did not do so when cron updates were enabled. Can anyone else corroborate this?

bleedev’s picture

Status: Closed (won't fix) » Postponed (maintainer needs more info)

I tested that scenario and got the same results. Will follow up after researching the cause.

bleedev’s picture

I tested that scenario and got the same results. Will follow up after researching the cause.

bleedev’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Committed update (currently in the Dev branch) that de-couples email address updates from cron processing. Email addresses updates should now be processed when the Drupal user is update whether cron processing is turned on or not.