You are here

function newsletter_send_draft in Newsletter 7

Send a custom newsletter draft.

Parameters

$nnid: The draft's key in Drupal's variable system, which is the newsletter's id.

1 call to newsletter_send_draft()
newsletter_form_send_draft_submit in includes/newsletter.admin.inc

File

includes/newsletter.admin.inc, line 1644
Admin page callbacks for the newsletter module.

Code

function newsletter_send_draft($nnid) {
  $drafts = variable_get('newsletter_custom_drafts', array());
  if (isset($drafts[$nnid]) && !empty($drafts[$nnid])) {
    $newsletter = newsletter_newsletter_load($nnid);
    newsletter_queue_custom_newsletter($drafts[$nnid]['subscribers'], $newsletter);
    unset($drafts[$nnid]);
    variable_set('newsletter_custom_drafts', $drafts);
  }
}