diff options
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/send.php | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/admin/send.php b/admin/send.php index d455a55..58dedcd 100644 --- a/admin/send.php +++ b/admin/send.php @@ -1,6 +1,6 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_newsletters/admin/send.php,v 1.7 2005/12/11 08:52:21 spiderr Exp $ +// $Header: /cvsroot/bitweaver/_bit_newsletters/admin/send.php,v 1.8 2005/12/20 22:05:07 spiderr Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. @@ -8,14 +8,15 @@ // Initialization require_once( '../../bit_setup_inc.php' ); -include_once( NEWSLETTERS_PKG_PATH.'nl_lib.php' ); -include_once( UTIL_PKG_PATH.'htmlMimeMail.php' ); +include_once( NEWSLETTERS_PKG_PATH.'BitMailer.php' ); $gBitSystem->verifyPackage( 'newsletters' ); require_once( NEWSLETTERS_PKG_PATH.'lookup_newsletter_edition_inc.php' ); -if (isset($_REQUEST["template_id"]) && $_REQUEST["template_id"] > 0) { +$feedback = array(); + +if( @BitBase::verifyId( $_REQUEST["template_id"] ) ) { $template_data = $tikilib->get_template($_REQUEST["template_id"]); $_REQUEST['edit'] = $template_data["content"]; @@ -30,9 +31,15 @@ if( $gContent->isValid() && isset( $_REQUEST['preview'] ) ) { $recipients = $gContent->getRecipients( $_REQUEST['send_group'] ); $gBitSmarty->assign_by_ref( 'recipientList', $recipients ); } elseif( $gContent->isValid() && isset( $_REQUEST["send"] ) ) { - $emails = $gContent->getRecipients( $_REQUEST['send_group'] ); - $gContent->queueRecipients( $emails ); -die; + if( $emails = $gContent->getRecipients( $_REQUEST['send_group'] ) ) { + global $gBitMailer; + $gBitMailer = new BitMailer(); + $gBitMailer->queueRecipients( $gContent->mContentId, $emails ); + $feedback['success'] = count( $emails ).' '.tra( 'emails were queued to be sent:' ).' '.$gContent->getTitle(); + $gContent->mEditionId = NULL; + } else { + $feedback['error'] = tra( 'No emails were queued.' ); + } } if( $gContent->isValid() ) { @@ -51,6 +58,7 @@ if( $gContent->isValid() ) { } } +$gBitSmarty->assign_by_ref( 'feedback', $feedback ); // Display the template $gBitSystem->display( 'bitpackage:newsletters/send_newsletters.tpl'); |
