You are here

function simplenews_rules_map_confirmation in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 simplenews_rules/simplenews_rules.rules.inc \simplenews_rules_map_confirmation()
  2. 8 simplenews_rules/simplenews_rules.rules.inc \simplenews_rules_map_confirmation()
  3. 7.2 simplenews_rules/simplenews_rules.rules.inc \simplenews_rules_map_confirmation()
  4. 7 simplenews_rules/simplenews_rules.rules.inc \simplenews_rules_map_confirmation()

Map args to the confrmation argument for subscribing/unsubscribing.

2 calls to simplenews_rules_map_confirmation()
simplenews_rules_action_subscribe in simplenews_rules/simplenews_rules.rules.inc
Action Implementation: Subscribe an e-mail adress to a Simplenews newsletter.
simplenews_rules_action_unsubscribe in simplenews_rules/simplenews_rules.rules.inc
Action Implementation: Unsubscribe an e-mail adress to a newsletter.

File

simplenews_rules/simplenews_rules.rules.inc, line 243
Rules hooks for the Simplenews newsletter module.

Code

function simplenews_rules_map_confirmation($args) {
  switch ($args['confirmation']) {
    case SIMPLENEWS_RULES_CONFIRMATION_YES:
      $confirmation = TRUE;
      break;
    case SIMPLENEWS_RULES_CONFIRMATION_NO:
      $confirmation = FALSE;
      break;
    case SIMPLENEWS_RULES_CONFIRMATION_DEFAULT:
      $confirmation = NULL;
      break;
  }
  return $confirmation;
}