You are here

function simplenews_issue_handler in Simplenews 7.2

Gets or sets the handler for an issue.

Parameters

$node: The issue to get or set the status.

$handler: (Optional) The recipient handler to be set or NULL to retrieve the current value.

Return value

The recipient handler name or FALSE if not set.

Related topics

3 calls to simplenews_issue_handler()
simplenews_add_node_to_spool in includes/simplenews.mail.inc
Add the newsletter node to the mail spool.
simplenews_node_tab_send_form in includes/simplenews.admin.inc
@todo
simplenews_node_tab_send_form_submit in includes/simplenews.admin.inc
@todo

File

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

Code

function simplenews_issue_handler($node, $handler = NULL) {
  $field = variable_get('simplenews_handler_field', 'simplenews_handler');
  if ($handler) {
    return $node->{$field} = array(
      LANGUAGE_NONE => array(
        array(
          'value' => $handler,
        ),
      ),
    );
  }
  elseif ($handler = field_get_items('node', $node, $field)) {
    return $handler[0]['value'];
  }
  return FALSE;
}