You are here

function simplenews_require_double_opt_in in Simplenews 7

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

Returns TRUE if the newsletter category 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 2655
Simplenews node handling, sent email, newsletter block and general hooks

Code

function simplenews_require_double_opt_in($tid, $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 {
    $category = simplenews_category_load($tid);
    return $category->opt_inout == 'double';
  }
}