summaryrefslogtreecommitdiff
path: root/BitMailer.php
diff options
context:
space:
mode:
Diffstat (limited to 'BitMailer.php')
-rw-r--r--BitMailer.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/BitMailer.php b/BitMailer.php
index 33219f6..298e1a0 100644
--- a/BitMailer.php
+++ b/BitMailer.php
@@ -1,12 +1,12 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_newsletters/Attic/BitMailer.php,v 1.10 2005/12/29 15:31:29 spiderr Exp $
+ * $Header: /cvsroot/bitweaver/_bit_newsletters/Attic/BitMailer.php,v 1.11 2005/12/29 17:22:47 spiderr Exp $
*
* Copyright (c) 2004 bitweaver.org
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
*
- * $Id: BitMailer.php,v 1.10 2005/12/29 15:31:29 spiderr Exp $
+ * $Id: BitMailer.php,v 1.11 2005/12/29 17:22:47 spiderr Exp $
*
* Class that handles editions of newsletters
* @package newsletters
@@ -15,7 +15,7 @@
*
* @author spiderr <spider@steelsun.com>
*
- * @version $Revision: 1.10 $ $Date: 2005/12/29 15:31:29 $ $Author: spiderr $
+ * @version $Revision: 1.11 $ $Date: 2005/12/29 17:22:47 $ $Author: spiderr $
*/
/**
@@ -101,7 +101,7 @@ class BitMailer extends phpmailer {
$pick['url_code'] = md5( $pick['content_id'].$pick['email'].$pick['queue_date'] );
$gBitSmarty->assign( 'url_code', $pick['url_code'] );
$unsub = $gBitSmarty->fetch( 'bitpackage:newsletters/unsubscribe_inc.tpl' );
- $htmlBody = $unsub . $body[$pick['content_id']]['body'] . $unsub;
+ $htmlBody = $unsub . $body[$pick['content_id']]['body'] . $unsub . '<img src="'.NEWSLETTERS_PKG_URI.'track.php?sub='.$pick['url_code'].'" alt="" />';
if( !$this->sendMail( $pick, $body[$pick['content_id']]['subject'], $htmlBody ) ) {
$this->logError( $pick );
@@ -136,6 +136,12 @@ class BitMailer extends phpmailer {
return $ret;
}
+ function trackMail( $pUrlCode ) {
+ global $gBitDb;
+ $query = "UPDATE `".BIT_DB_PREFIX."tiki_mail_queue` SET `reads`=`reads`+1, `last_read_date`=? WHERE `url_code`=? ";
+ $gBitDb->query( $query, array( time(), $pUrlCode ) );
+ }
+
function logError( $pInfo ) {
if( !empty( $pInfo['url_code'] ) && !$this->mDb->getOne( "SELECT `url_code` FROM `".BIT_DB_PREFIX."tiki_mail_errors` WHERE `url_code`=?", array( $pInfo['url_code'] ) ) ) {
$store['url_code'] = $pInfo['url_code'];