You are here

function simplenews_require_double_opt_in in Simplenews 7.2

Same name and namespace in other branches
  1. 7 simplenews.module \simplenews_require_double_opt_in()

Returns TRUE if the newsletter requires double opt in.

Related topics

3 calls to simplenews_require_double_opt_in()
simplenews_block_form_submit in includes/simplenews.subscription.inc
simplenews_rules_map_confirmation in simplenews_rules/simplenews_rules.rules.inc
Map args to the confrmation argument for subscribing/unsubscribing.
simplenews_subscriptions_page_form_submit in includes/simplenews.subscription.inc
FAPI PAGE subscription form_submit.

File

./simplenews.module, line 2861
Simplenews node handling, sent email, newsletter block and general hooks

Code

function simplenews_require_double_opt_in($newsletter_id, $account) {
  global $user;

  // If email belongs to the current registered user, don't send confirmation.
  // Other addresses receive a confirmation if double opt-in is selected.
  if (!empty($account->uid) && !empty($user->uid) && $account->uid == $user->uid) {
    return FALSE;
  }
  else {
    $newsletter = simplenews_newsletter_load($newsletter_id);
    return $newsletter->opt_inout == 'double';
  }
}