diff options
| author | Christian Fowler <spider@viovio.com> | 2005-12-30 00:24:19 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2005-12-30 00:24:19 +0000 |
| commit | 8759f404aa53e377f8dba93649989e79086b482c (patch) | |
| tree | 924910be4146e775eb07d7ee08d5db47cdd08bf2 | |
| parent | ed52dd4b996fe86e5e3bcc9d6e4d9bcbaeb8b6fc (diff) | |
| download | newsletters-8759f404aa53e377f8dba93649989e79086b482c.tar.gz newsletters-8759f404aa53e377f8dba93649989e79086b482c.tar.bz2 newsletters-8759f404aa53e377f8dba93649989e79086b482c.zip | |
add reply_to column and field to editions
| -rw-r--r-- | BitMailer.php | 12 | ||||
| -rw-r--r-- | BitNewsletterEdition.php | 7 | ||||
| -rw-r--r-- | admin/schema_inc.php | 1 | ||||
| -rw-r--r-- | templates/edit_edition.tpl | 12 |
4 files changed, 22 insertions, 10 deletions
diff --git a/BitMailer.php b/BitMailer.php index 34d79e3..ac18dce 100644 --- a/BitMailer.php +++ b/BitMailer.php @@ -1,12 +1,12 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_newsletters/Attic/BitMailer.php,v 1.14 2005/12/29 22:19:04 bitweaver Exp $ + * $Header: /cvsroot/bitweaver/_bit_newsletters/Attic/BitMailer.php,v 1.15 2005/12/30 00:24:18 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.14 2005/12/29 22:19:04 bitweaver Exp $ + * $Id: BitMailer.php,v 1.15 2005/12/30 00:24:18 spiderr Exp $ * * Class that handles editions of newsletters * @package newsletters @@ -15,7 +15,7 @@ * * @author spiderr <spider@steelsun.com> * - * @version $Revision: 1.14 $ $Date: 2005/12/29 22:19:04 $ $Author: bitweaver $ + * @version $Revision: 1.15 $ $Date: 2005/12/30 00:24:18 $ $Author: spiderr $ */ /** @@ -36,7 +36,7 @@ class BitMailer extends phpmailer { $this->mDb = $gBitDb; $this->From = $gBitSystem->getPreference( 'bitmailer_sender_email', $gBitSystem->getPreference( 'sender_email', $_SERVER['SERVER_ADMIN'] ) ); $this->FromName = $gBitSystem->getPreference( 'bitmailer_from', $gBitSystem->getPreference( 'siteTitle' ) ); - $this->Host = $gBitSystem->getPreference( 'bitmailer_servers', $gBitSystem->getPreference( 'feature_server_name', $_SERVER['HTTP_HOST'] ) ); + $this->Host = $gBitSystem->getPreference( 'bitmailer_servers', $gBitSystem->getPreference( 'feature_server_name', '127.0.0.1' ) ); $this->Mailer = $gBitSystem->getPreference( 'bitmailer_protocol', 'smtp' ); // Alternative to IsSMTP() $this->WordWrap = $gBitSystem->getPreference( 'bitmailer_word_wrap', 75 ); if( !$this->SetLanguage( $gBitLanguage->getLanguage(), UTIL_PKG_PATH.'phpmailer/language/' ) ) { @@ -74,7 +74,7 @@ class BitMailer extends phpmailer { } function tendQueue() { - global $gBitSmarty; + global $gBitSmarty, $gBitSystem; $body = array(); $this->mDb->StartTrans(); $query = "SELECT * @@ -94,6 +94,7 @@ class BitMailer extends phpmailer { if( $content->load() ) { $body[$pick['content_id']]['body'] = $content->render(); $body[$pick['content_id']]['subject'] = $content->getTitle(); + $body[$pick['content_id']]['reply_to'] = $content->getField( 'reply_to', $gBitSystem->getPreference( 'sender_email', $_SERVER['SERVER_ADMIN'] ) ); $body[$pick['content_id']]['object'] = $content; } // $content[$pick['content_id']] = LibertyBase::getLibertyObject(); @@ -108,6 +109,7 @@ class BitMailer extends phpmailer { } $htmlBody = $unsub . $body[$pick['content_id']]['body'] . $unsub . '<img src="'.NEWSLETTERS_PKG_URI.'track.php?sub='.$pick['url_code'].'" alt="" />'; + $this->AddReplyTo( $body[$pick['content_id']]['reply_to'], $gBitSystem->getPreference( 'bitmailer_from' ) ); print "TO: $pick[email]\t"; if( $this->sendMail( $pick, $body[$pick['content_id']]['subject'], $htmlBody ) ) { print "SENT\n"; diff --git a/BitNewsletterEdition.php b/BitNewsletterEdition.php index 239cf66..7c9a06a 100644 --- a/BitNewsletterEdition.php +++ b/BitNewsletterEdition.php @@ -1,12 +1,12 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_newsletters/BitNewsletterEdition.php,v 1.13 2005/12/29 18:46:39 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_newsletters/BitNewsletterEdition.php,v 1.14 2005/12/30 00:24:18 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: BitNewsletterEdition.php,v 1.13 2005/12/29 18:46:39 spiderr Exp $ + * $Id: BitNewsletterEdition.php,v 1.14 2005/12/30 00:24:18 spiderr Exp $ * * Class that handles editions of newsletters * @package newsletters @@ -15,7 +15,7 @@ * * @author spiderr <spider@steelsun.com> * - * @version $Revision: 1.13 $ $Date: 2005/12/29 18:46:39 $ $Author: spiderr $ + * @version $Revision: 1.14 $ $Date: 2005/12/30 00:24:18 $ $Author: spiderr $ */ /** @@ -51,6 +51,7 @@ class BitNewsletterEdition extends LibertyAttachable { $this->mErrors['nl_content_id'] = tra( 'No newsletter was selected for this edition.' ); } $pParamHash['edition_store']['is_draft'] = !empty( $pParamHash['is_draft'] ) ? 'y' : NULL; + $pParamHash['edition_store']['reply_to'] = !empty( $pParamHash['reply_to'] ) ? $pParamHash['reply_to'] : NULL; return( count( $this->mErrors ) == 0 ); } diff --git a/admin/schema_inc.php b/admin/schema_inc.php index ad88f8d..be10d8c 100644 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -18,6 +18,7 @@ $tables = array( edition_id I4 AUTO PRIMARY, nl_content_id I4 NOTNULL, is_draft C(1), + reply_to C(160), content_id I4 NOTNULL CONSTRAINTS ', CONSTRAINT `tiki_nl_ed_nl_con_ref` FOREIGN KEY (`nl_content_id`) REFERENCES `".BIT_DB_PREFIX."tiki_content`( `content_id` ) , CONSTRAINT `tiki_nl_ed_con_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."tiki_content`( `content_id` )' diff --git a/templates/edit_edition.tpl b/templates/edit_edition.tpl index bace0c6..f27ec4c 100644 --- a/templates/edit_edition.tpl +++ b/templates/edit_edition.tpl @@ -62,15 +62,23 @@ <div class="row"> {formlabel label="Subject" for="subject"} {forminput} - <input type="text" maxlength="250" size="40" name="title" id="subject" value="{$gContent->getTitle()|escape}" /> + <input type="text" maxlength="250" size="40" name="title" id="subject" value="{$gContent->getTitle()|escape:html}" /> {formhelp note="This will appear in the <strong>subject</strong> line of the email."} {/forminput} </div> <div class="row"> + {formlabel label="Reply-To" for="replyto"} + {forminput} + <input type="text" maxlength="250" size="40" name="reply_to" id="replyto" value="{$gContent->getField('reply_to')|default:$gBitSystem->getPreference('sender_email',$smarty.server.SERVER_ADMIN)|escape:html}" /> + {formhelp note="This is the email address to which any replies will be sent."} + {/forminput} + </div> + + <div class="row"> {formlabel label="Body" for="body"} {forminput} - <textarea name="edit" id="body" rows="25" cols="50">{$gContent->getField('data')|escape}</textarea> + <textarea name="edit" id="body" rows="25" cols="50">{$gContent->getField('data')|escape:html}</textarea> {formhelp note=""} {/forminput} </div> |
