From 8759f404aa53e377f8dba93649989e79086b482c Mon Sep 17 00:00:00 2001 From: Christian Fowler Date: Fri, 30 Dec 2005 00:24:19 +0000 Subject: add reply_to column and field to editions --- BitMailer.php | 12 +++++++----- BitNewsletterEdition.php | 7 ++++--- admin/schema_inc.php | 1 + 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 @@ * - * @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 . ''; + $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 @@ * - * @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 @@
{formlabel label="Subject" for="subject"} {forminput} - + {formhelp note="This will appear in the subject line of the email."} {/forminput}
+
+ {formlabel label="Reply-To" for="replyto"} + {forminput} + + {formhelp note="This is the email address to which any replies will be sent."} + {/forminput} +
+
{formlabel label="Body" for="body"} {forminput} - + {formhelp note=""} {/forminput}
-- cgit v1.3