diff --git a/modules/mailchimp_lists/mailchimp_lists.module b/modules/mailchimp_lists/mailchimp_lists.module index d393d2a..f5a6cc1 100644 --- a/modules/mailchimp_lists/mailchimp_lists.module +++ b/modules/mailchimp_lists/mailchimp_lists.module @@ -149,6 +149,14 @@ function mailchimp_lists_cron() { // If there is a valid account, load data from it: if (!empty($item->data['uid'])) { $account = user_load($item->data['uid']); + if (!$account->status) { + // If user is blocked when cron processes don't sync them to the list + // and delete their queue item. User will enter the queue when they + // are unblocked thanks to mailchimp's hook_user_update implementation. + $queue->deleteItem($item); + $count++; + continue; + } $email = $account->mail; $mergevars = mailchimp_lists_load_user_mergevars($account, $list); }