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