diff options
| author | Christian Fowler <spider@viovio.com> | 2006-10-07 05:18:56 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2006-10-07 05:18:56 +0000 |
| commit | 6c0ef4d4b60ce9edcd848743c1e4682f3ea6d3f4 (patch) | |
| tree | a943fec0f50924cf871a891daf3013dcce71b712 /admin | |
| parent | 487dbd3593443f0a35390b7a685864b1d7f7ce1e (diff) | |
| download | newsletters-6c0ef4d4b60ce9edcd848743c1e4682f3ea6d3f4.tar.gz newsletters-6c0ef4d4b60ce9edcd848743c1e4682f3ea6d3f4.tar.bz2 newsletters-6c0ef4d4b60ce9edcd848743c1e4682f3ea6d3f4.zip | |
major clean up to newsletter sending. everything pretty clean at this point. unsub needs work
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/mail_queue.php | 17 | ||||
| -rw-r--r-- | admin/schema_inc.php | 8 | ||||
| -rw-r--r-- | admin/tend_mail_queue.php | 1 |
3 files changed, 17 insertions, 9 deletions
diff --git a/admin/mail_queue.php b/admin/mail_queue.php index 1d9938b..b16228e 100644 --- a/admin/mail_queue.php +++ b/admin/mail_queue.php @@ -9,14 +9,19 @@ require_once( NEWSLETTERS_PKG_PATH.'BitMailer.php' ); global $gBitMailer; $gBitMailer = new BitMailer(); -if( !empty( $_REQUEST['tend_queue'] ) ) { - $gBitMailer->tendQueue(); -} else { - $listHash = array(); - $queue = $gBitMailer->getQueue( $listHash ); - $gBitSmarty->assign_by_ref( 'queue', $queue ); +if( !empty( $_REQUEST['batch_command'] ) && !empty( $_REQUEST['queue_id'] ) ) { + if( $_REQUEST['batch_command'] == 'delete' ) { + foreach( $_REQUEST['queue_id'] as $qId ) { + $gBitMailer->expungeQueueRow( $qId ); + } + } elseif( $_REQUEST['batch_command'] == 'send' ) { + } } +$listHash = array(); +$queue = $gBitMailer->getQueue( $listHash ); +$gBitSmarty->assign_by_ref( 'queue', $queue ); + $gBitSystem->display( 'bitpackage:newsletters/mail_queue.tpl' ); ?> diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 5b8daed..dbcfc93 100644 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -27,7 +27,7 @@ $tables = array( 'mail_subscriptions' => " email C(160), user_id I4, - nl_content_id I4, + content_id I4, sub_code C(36), is_valid C(1), subscribed_date I8, @@ -57,8 +57,9 @@ $tables = array( ", 'mail_queue' => " - content_id I4 PRIMARY, - email C(160) PRIMARY, + mail_queue_id PRIMARY, + content_id I4 NOTNULL, + email C(160) NOTNULL, nl_content_id I4 NOTNULL, user_id I4, url_code C(32), @@ -97,6 +98,7 @@ $indices = array ( 'mailq_email_idx' => array( 'table' => 'mail_queue', 'cols' => 'email', 'opts' => NULL ), 'mailq_user_idx' => array( 'table' => 'mail_queue', 'cols' => 'user_id', 'opts' => NULL ), 'mailq_content_idx' => array( 'table' => 'mail_queue', 'cols' => 'content_id', 'opts' => NULL ), + 'mailq_user_content_idx' => array( 'table' => 'mail_queue', 'cols' => 'content_id', 'opts' => array( 'UNIQUE' ) ), 'mailq_sent_idx' => array( 'table' => 'mail_queue', 'cols' => 'sent_date', 'opts' => NULL ), ); $gBitInstaller->registerSchemaIndexes( NEWSLETTERS_PKG_NAME, $indices ); diff --git a/admin/tend_mail_queue.php b/admin/tend_mail_queue.php index f7bcbd8..14f815b 100644 --- a/admin/tend_mail_queue.php +++ b/admin/tend_mail_queue.php @@ -8,6 +8,7 @@ $_SERVER['SERVER_NAME'] = ''; $_SERVER['SERVER_ADMIN'] = ''; $_SERVER['SERVER_SOFTWARE'] = 'command line'; + $_REQUEST['uri_mode'] = TRUE; /** * required setup |
