You are here

function simplenews_admin_users_delete_submit in Simplenews 5

Forms API callback; delete user subscription submit.

File

./simplenews.module, line 2476

Code

function simplenews_admin_users_delete_submit($form_id, $form_values) {
  if ($form_values['confirm']) {
    $account = db_fetch_object(db_query('SELECT mail FROM {simplenews_subscriptions} WHERE snid = %d', $form_values['snid']));
    simplenews_delete_subscription($form_values['snid']);
    drupal_set_message(t('The user %user was successfully deleted from the subscription list.', array(
      '%user' => $account->mail,
    )));
    return 'admin/content/newsletters/users';
  }
}