function _mailchimp_unsubscribe_user in Mailchimp 6
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()
- 7 mailchimp.module \_mailchimp_unsubscribe_user()
Unsubscribe the given user to the given list
2 calls to _mailchimp_unsubscribe_user()
File
- ./
mailchimp.module, line 732 - Mailchimp module.
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
}