function mailchimp_unsubscribe_form_submit in Mailchimp 5.2
Same name and namespace in other branches
- 5 mailchimp.module \mailchimp_unsubscribe_form_submit()
- 6.2 mailchimp.module \mailchimp_unsubscribe_form_submit()
- 6 mailchimp.module \mailchimp_unsubscribe_form_submit()
- 7 mailchimp.module \mailchimp_unsubscribe_form_submit()
File
- ./
mailchimp.module, line 548
Code
function mailchimp_unsubscribe_form_submit($form_values = array()) {
if ($q || ($q = _mailchimp_get_api_object())) {
$success = TRUE;
foreach ((array) $q
->lists() as $list) {
$success = $success && _mailchimp_unsubscribe_user($list, $form['EMAIL'], TRUE, $q);
if ($success) {
drupal_set_message(variable_get('mailchimp_unsubscription_success_message', SUBSCRIPTION_SUCCESS));
}
else {
drupal_set_message(variable_get('mailchimp_unsubscription_failure_message', SUBSCRIPTION_SUCCESS));
}
}
}
}