_e('SENDING PAUSED'); ?> </a> | <a href="<?php echo module_newsletter::link_preview($newsletter['newsletter_id']); ?> "><?php _e('Preview'); ?> </a> <?php break; case _NEWSLETTER_STATUS_PENDING: ?> <a href="<?php echo module_newsletter::link_queue_watch($newsletter['newsletter_id'], $newsletter['send_id']); ?> "><?php _e('CURRENTLY SENDING'); ?> </a> | <a href="<?php echo module_newsletter::link_preview($newsletter['newsletter_id']); ?> "><?php _e('Preview'); ?> </a> <?php break; case _NEWSLETTER_STATUS_NEW:
$newsletter_id = isset($_REQUEST['newsletter_id']) ? (int) $_REQUEST['newsletter_id'] : false; if (!$newsletter_id) { set_error('Sorry no newsletter id specified'); redirect_browser(module_newsletter::link_list(0)); } $newsletter = module_newsletter::get_newsletter($newsletter_id); // great a new blank send table ready to go (only if user clicks confirm) $send_id = isset($_REQUEST['send_id']) ? (int) $_REQUEST['send_id'] : false; if (!$send_id) { set_error('Sorry no newsletter send id specified'); redirect_browser(module_newsletter::link_open($newsletter_id)); } $send = module_newsletter::get_send($send_id); if ($send['status'] != _NEWSLETTER_STATUS_SENT) { // hasnt sent yet, redirect to the pending watch page. redirect_browser(module_newsletter::link_queue_watch($newsletter_id, $send_id)); } $start_time = $send['start_time']; if (isset($_REQUEST['show'])) { // render the newsletter and display it on screen with nothing else. $content = module_newsletter::render($newsletter_id, $send_id, false, 'preview'); // do the link click overview here: ob_end_clean(); // grab all the links for this send $send_links = get_multiple('newsletter_link', array('send_id' => $send_id)); $links_to_process = array(); $old_links_by_url = array(); foreach ($send_links as $send_link) { // we have to do this because the link processing part puts a unique member id into these unsubscribe/view online links. $parsed_url = preg_replace('#\\&nm=\\d+#', '&nm=', $send_link['link_url']); $parsed_url = preg_replace('#\\&hash=\\w+#', '&nm=', $parsed_url);
function start_send_manual(){ run_manual_send = true; $('#manual_send_paused').hide(); $('#manual_send_running').show(); $('#manual_send_status').prepend('<li><?php _e('Starting manual send'); ?> </li>'); do_manual_send(); } function finished_send_manual(){ run_manual_send = false; $('#manual_send_paused').hide(); $('#manual_send_running').hide(); $('#manual_send_status').prepend('<li><?php _e('Sending complete. Please <a href="%s">click here</a> to refresh the page.', module_newsletter::link_queue_watch($newsletter_id, $send_id)); ?> </li>'); $('#change_status_buttons').hide(); } function do_manual_send(){ if(!run_manual_send){ return; } // do an ajax call to the newsletter_queue_manual.php script // parse the result and update the corresponding recipient in the listing $('#manual_send_status').prepend('<li><?php _e('Telling server to send in batches of %s, please wait...', module_config::c('newsletter_send_burst_count', 40)); ?> </li>'); $.ajax({