You are here

function simplenews_confirmation_add_combined in Simplenews 7

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

Add a mail confirmation or fetch them.

Parameters

$action: (Optional) The confirmation type, either subscribe or unsubscribe.

$subscriber: (Optional) The subscriber object.

$category: (Optional) The newsletter category object.

Return value

If no arguments are passed in, an array of current confirmations, keyed by subscriber id, the value is an array with the keys action and tid.

2 calls to simplenews_confirmation_add_combined()
simplenews_confirmation_send in ./simplenews.module
Send a confirmation mail.
simplenews_confirmation_send_combined in ./simplenews.module
Send collected confirmations.

File

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

Code

function simplenews_confirmation_add_combined($action = NULL, $subscriber = NULL, $category = NULL) {
  $group =& drupal_static(__FUNCTION__, array());
  if (!empty($action)) {
    $group[$subscriber->mail][$category->tid] = $action;
  }
  else {
    return $group;
  }
}