You are here

function simplenews_newsletter_defaults in Simplenews 7

Return default newsletter.

6 calls to simplenews_newsletter_defaults()
simplenews_newsletter_update_sent_status in ./simplenews.module
Update the sent status of a node.
simplenews_node_insert in ./simplenews.module
Implements hook_node_insert().
simplenews_node_load in ./simplenews.module
Implements hook_node_load().
simplenews_node_presave in ./simplenews.module
Implements hook_node_presave().
simplenews_node_tab_send_form_submit in includes/simplenews.admin.inc
@todo

... See full list

File

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

Code

function simplenews_newsletter_defaults($node = NULL) {
  $newsletter = array(
    'nid' => NULL,
    'tid' => NULL,
    'status' => SIMPLENEWS_STATUS_SEND_NOT,
    'sent_subscriber_count' => 0,
  );
  if ($node) {
    $newsletter['nid'] = isset($node->nid) ? $node->nid : NULL;
    $terms = simplenews_get_term_values($node);
    $newsletter['tid'] = $terms[0]['tid'];
  }
  return $newsletter;
}