Hi there, I've been working with Mailchimp on this issue and they have suggested I bring it up with you guys.

We already had a list of subscribers from our site which used to have a simple sign up field on registration, every week we manually imported these new subscribers to our list in mailchimp. As we wanted to make it as automated as possible we added the Mailchimp module a few weeks ago and replaced the signup field with the Mailchimp sign up field.

Everything worked fine until we started getting emails from Mailchimp to our test accounts asking us to subscribe to our list, these accounts hadn't been accessed for a while, then we started getting people resubscribing, again users who hadn't been on the site for a while. I presumed it was a Mailchimp issue to do with resubscribing but they have said the following:

Thanks for following up with us and providing us that extra bit of info. In this particular situation, the subscribers are being added via a 3rd party integration that is using the API to pass information to MailChimp. The best thing we can recommend in this situation is to reach out to the folks who made this particular integration to see what the behavior is if someone is already on the list and are added again via the integration. They may have some tips to prevent them from going through the double opt-in process again.

We can confirm that these emails are being triggered because they are being added to the list with double opt-in enabled. Essentially the integration team that made this is going to need to be worked with to figure out what the expected behaviors are with this specific integration, as well as see if they have a way of turning this behavior off within the integration's settings.

The strange thing is that I have never turned on the double opt in option on the module nor have a lot of these people actively been added via the API. Is there a way around this as we're getting complaints that we're spamming people (even though in reality it's just a double confirmation not anything malicious).

I can't work out whether this is actually related to a bug in the double opt in or in fact it is working as expected but it's something that potentially needs to be changed so that if subscribers are already on the list then they should not be added to the list again or sent a confirmation email.

Thanks,

Comments

gc11’s picture

Priority: Normal » Critical

Hi any chance of a reply to this? It now seems people are getting these emails more than once, which is obviously harder to manage.

Thanks.

hibersh’s picture

Assigned: Unassigned » hibersh
silkogelman’s picture

Is this a Mailchimp module issue or a Commerce Mailchimp module issue?

@gc11 can you describe what versions of the modules you are using and in what way the cases relate to commerce_mailchimp module?

mixedfeelings’s picture

I am actually the same problem described in the no-list during checkout thread, but in this case: https://drupal.org/node/1967836

It's the exact same error but only for repeat customers where the user is already on the list.

Notice: Undefined index: commerce_mailchimp in commerce_mailchimp_pane_checkout_form_validate() (line 89 of ***/sites/all/modules/commerce_mailchimp/includes/commerce_mailchimp.checkout_pane.inc).
Warning: Invalid argument supplied for foreach() in commerce_mailchimp_pane_checkout_form_validate() (line 89 of ***/sites/all/modules/commerce_mailchimp/includes/commerce_mailchimp.checkout_pane.inc).

I am using the newest versions of the mailchimp and commerce_mailchimp modules.

Any ideas?

bensey’s picture

Title: Double opt in causes problems when people are already on list » Pane form validation function needs to check that correct array is defined before proceeding

Hi guys,

have run into this issue myself, and it has nothing to do with the double opt-in.

It's caused by the signup pane form function and it's validation function. The signup pane checks if the user's email address is already on the list, and doesn't display the pane if the user is already subscribed to the list. The validation function works using the $form_state['values']['commerce_mailchimp'] array. This is not defined if the pane is not displayed (because the user was already subscribed), and therefore doesn't make it onto the $form_state array, causing the error.

My solution to this was to just add a check to see if $form_state['values']['commerce_mailchimp'] is actually set in the $form_state array so it doesn't try to operate on an array that doesn't exist.

Updated function is below.

function commerce_mailchimp_pane_checkout_form_validate($form, &$form_state, $checkout_pane, $order) {
  $lists = mailchimp_lists_load_multiple_by_name();
  if(!empty($form_state['values']['commerce_mailchimp'])){
    foreach ($form_state['values']['commerce_mailchimp'] as $name => $value) {
      $list = $lists[$name];
      $force = variable_get("commerce_mailchimp_{$list->mc_list_id}_checkout_pane_toggled_disabled",0);
      if ($force && !$value) {
        form_set_error('', t("To be able to send important product updates we need your permission to email you. Please check the email subscription box below to give us that permission."));
        return FALSE;
      }
    }
  }

  return TRUE;
}

  • Jim.M committed 78b8f13 on 7.x-1.x authored by bensey
    Issue #2090607 by bensey: Pane form validation function needs to check...
jim.m’s picture

Status: Active » Fixed

Thanks for the contribution bensey.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.