You are here

function simplenews_confirm_add_form_submit in Simplenews 7.2

Same name and namespace in other branches
  1. 5 simplenews.module \simplenews_confirm_add_form_submit()
  2. 6.2 includes/simplenews.subscription.inc \simplenews_confirm_add_form_submit()
  3. 6 simplenews.subscription.inc \simplenews_confirm_add_form_submit()
  4. 7 includes/simplenews.subscription.inc \simplenews_confirm_add_form_submit()

File

includes/simplenews.subscription.inc, line 650
(Un)subscription and (un)subscription confirmation

Code

function simplenews_confirm_add_form_submit($form, &$form_state) {
  simplenews_subscribe($form_state['values']['mail'], $form_state['values']['newsletter']->newsletter_id, FALSE, 'website');
  if (!($path = variable_get('simplenews_confirm_subscribe_page', ''))) {
    $path = variable_get('site_frontpage', 'node');
    drupal_set_message(t('%user was added to the %newsletter mailing list.', array(
      '%user' => $form_state['values']['mail'],
      '%newsletter' => $form_state['values']['newsletter']->name,
    )));
  }
  $form_state['redirect'] = $path;
}