You are here

function simplenews_admin_newsletter_delete_submit in Simplenews 7.2

Form submit callback for deleting a simplenews.

File

includes/simplenews.admin.inc, line 660
Newsletter admin, subscription admin, simplenews settings

Code

function simplenews_admin_newsletter_delete_submit($form, &$form_state) {
  $newsletter_id = $form_state['values']['newsletter_id'];
  $name = $form_state['values']['name'];

  // Delete newsletter.
  // Subscriptions are deleted by simplenews_simplenews_newsletter_delete()
  simplenews_newsletter_delete($newsletter_id);
  drupal_set_message(t('Newsletter %name has been deleted.', array(
    '%name' => $name,
  )));
  $form_state['redirect'] = 'admin/config/services/simplenews';
}