verifyPermission( 'p_mail_admin' ); $gBitSystem->verifyPermission( 'newsletters' ); require_once( NEWSLETTERS_PKG_CLASS_PATH.'BitNewsletterMailer.php' ); global $gBitNewsletterMailer; $gBitNewsletterMailer = new BitNewsletterMailer(); if( !empty( $_REQUEST['batch_command'] ) && !empty( $_REQUEST['queue_id'] ) ) { if( $_REQUEST['batch_command'] == 'delete' ) { foreach( $_REQUEST['queue_id'] as $qId ) { $gBitNewsletterMailer->expungeQueueRow( $qId ); } } elseif( $_REQUEST['batch_command'] == 'send' && !empty( $_REQUEST['queue_id'] ) ) { foreach( $_REQUEST['queue_id'] as $queueId ) { $gBitNewsletterMailer->sendQueue( $queueId ); } } } if( empty( $_REQUEST['batch_command'] ) || $_REQUEST['batch_command'] != 'send' ) { $listHash = []; $queue = $gBitNewsletterMailer->getQueue( $listHash ); $gBitSmarty->assign( 'queue', $queue ); $gBitSystem->display( 'bitpackage:newsletters/mail_queue.tpl' , NULL, [ 'display_mode' => 'admin' ]); }