function _mailchimp_unsubscribe_user in Mailchimp 5
Same name and namespace in other branches
- 5.2 mailchimp.module \_mailchimp_unsubscribe_user()
- 6.2 mailchimp.module \_mailchimp_unsubscribe_user()
- 6 mailchimp.module \_mailchimp_unsubscribe_user()
- 7 mailchimp.module \_mailchimp_unsubscribe_user()
Unsubscribe the given user to the given list
2 calls to _mailchimp_unsubscribe_user()
File
- ./
mailchimp.module, line 725
Code
function _mailchimp_unsubscribe_user($list, $mail, $message = true, $q = NULL) {
if ($q || ($q = _mailchimp_get_api_object())) {
if (_mailchimp_is_subscribed($list['id'], $mail, $q)) {
$success = $q
->listUnsubscribe($list['id'], $mail, false);
if ($message && $success) {
drupal_set_message(t('You have unsubscribed from %list.', array(
'%list' => $list['name'],
)));
}
}
}
return true;
//$success; // the mailchim api seems to always return false on unsubscribe operations
}