You are here

function mailchimp_user_delete in Mailchimp 7

Implements hook_user_delete().

File

./mailchimp.module, line 107
Mailchimp module.

Code

function mailchimp_user_delete($account) {
  if ($q = _mailchimp_get_api_object()) {

    // remove a user from all required lists.
    foreach ((array) _mailchimp_get_required_lists() as $list) {
      db_delete('mailchimp_user')
        ->condition('uid', $account->uid)
        ->execute();
      _mailchimp_unsubscribe_user($list, $account->mail, FALSE, $q);
    }
  }
}