function _mailchimp_unsubscribe_user in Mailchimp 6.2
Same name and namespace in other branches
- 5.2 mailchimp.module \_mailchimp_unsubscribe_user()
- 5 mailchimp.module \_mailchimp_unsubscribe_user()
- 6 mailchimp.module \_mailchimp_unsubscribe_user()
- 7 mailchimp.module \_mailchimp_unsubscribe_user()
Unsubscribe the given user from the given list
3 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 in ./
mailchimp.module - Implementation of hook_user
File
- ./
mailchimp.module, line 1003 - Mailchimp module.
Code
function _mailchimp_unsubscribe_user($list, $mail, $message = TRUE, $q = NULL) {
if ($q || ($q = _mailchimp_get_api_object())) {
$success = FALSE;
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 %email from the %list list.', array(
'%email' => $mail,
'%list' => $list->name,
)));
}
}
}
return $success;
}