You are here

function comment_notify_unsubscribe_submit in Comment Notify 7

Same name and namespace in other branches
  1. 5.2 comment_notify.module \comment_notify_unsubscribe_submit()
  2. 5 comment_notify.module \comment_notify_unsubscribe_submit()
  3. 6 comment_notify.module \comment_notify_unsubscribe_submit()

Based on admin submit, do the actual unsubscribe from notifications.

File

./comment_notify.module, line 586
This module provides comment follow-up e-mail notification for anonymous and registered users.

Code

function comment_notify_unsubscribe_submit($form, &$form_state) {
  module_load_include('inc', 'comment_notify', 'comment_notify');
  $email = trim($form_state['values']['email_to_unsubscribe']);
  $comments = comment_notify_unsubscribe_by_email($email);

  // Update the admin about the state of this comment notification subscription.
  if ($comments == 0) {
    drupal_set_message(t("There were no active comment notifications for that email."));
  }
  else {
    drupal_set_message(format_plural($comments, "Email unsubscribed from 1 comment notification.", "Email unsubscribed from @count comment notifications."));
  }
}