You are here

function mailchimp_lists_user_delete in Mailchimp 7.2

Implements hook_user_delete().

File

modules/mailchimp_lists/mailchimp_lists.module, line 289
Mailchimp lists module.

Code

function mailchimp_lists_user_delete($account) {

  // Unsubscribe a user from all required & optional lists:
  // Load any lists that they have access to by role:
  $lists = mailchimp_lists_get_available_lists($account);
  if (!empty($lists)) {
    foreach ($lists as $list) {

      // @todo: after we have local preference tracking, remove only lists
      // that are required or opted in.
      mailchimp_lists_execute_change('remove', $list, $account->mail);
    }
  }
}