// $_REQUEST["preview"] = 1; } $gBitSmarty->assign('preview', 'n'); $gBitSmarty->assign('presend', 'n'); $gBitSmarty->assign('emited', 'n'); $validated = !empty($_REQUEST["validated"]) ? TRUE : FALSE; if ($gContent->isValid() && isset($_REQUEST['preview']) && isset($_REQUEST['send_group'])) { $recipients = $gContent->getRecipients($_REQUEST['send_group'], $validated, !empty($_REQUEST['test_mode'])); $gBitSmarty->assignByRef('recipientList', $recipients); $gBitSmarty->assign('validated', $validated); $gBitSmarty->assign('sending', TRUE); } elseif ($gContent->isValid() && isset($_REQUEST["send"])) { if ($emails = $gContent->getRecipients($_REQUEST['send_group'], $validated, !empty($_REQUEST['test_mode']))) { global $gBitNewsletterMailer; $gBitNewsletterMailer = new BitNewsletterMailer(); $queueCount = $gBitNewsletterMailer->queueRecipients($gContent->mContentId, $gContent->mNewsletter->mContentId, $emails, !empty($_REQUEST['test_mode'])); $feedback['success'] = $queueCount . ' ' . tra('emails were queued to be sent:') . ' ' . $gContent->getTitle(); $gContent->mEditionId = NULL; } else { $feedback['error'] = tra('No emails were queued.'); } } if ($gContent->isValid()) { $groupListHash = array(); $groups = $gBitUser->getAllGroups($groupListHash); $groups['send_subs']['group_name'] = 'Send to subscribers'; $gBitSmarty->assignByRef('groupList', $groups); } else { $listHash = array(); $editions = $gContent->getList($listHash); $gBitSmarty->assignByRef('editionList', $editions);