function _mailchimp_unsubscribe_user in Mailchimp 7
Same name and namespace in other branches
- 5.2 mailchimp.module \_mailchimp_unsubscribe_user()
- 5 mailchimp.module \_mailchimp_unsubscribe_user()
- 6.2 mailchimp.module \_mailchimp_unsubscribe_user()
- 6 mailchimp.module \_mailchimp_unsubscribe_user()
Unsubscribe the given user from the given list
5 calls to _mailchimp_unsubscribe_user()
- mailchimp_subscribe_auth_form_submit in ./
mailchimp.module - Submit handler to add users to lists when editing/creating a user
- mailchimp_unsubscribe_form_submit in ./
mailchimp.module - submit handler for unsubscribe form
- mailchimp_user_delete in ./
mailchimp.module - Implements hook_user_delete().
- mailchimp_user_insert in ./
mailchimp.module - Implements hook_user_insert().
- mailchimp_user_update in ./
mailchimp.module - Implements hook_user_update().
File
- ./
mailchimp.module, line 851 - Mailchimp module.
Code
function _mailchimp_unsubscribe_user($list, $mail, $message = TRUE, $q = NULL) {
$success = FALSE;
if ($q || ($q = _mailchimp_get_api_object())) {
if (_mailchimp_is_subscribed($list->id, $mail, $q)) {
$success = $q
->listUnsubscribe($list->id, $mail, FALSE, FALSE, FALSE);
if ($message && $success) {
drupal_set_message(t('You have unsubscribed from %list.', array(
'%list' => $list->name,
)));
}
}
}
return $success;
}