|
From: Greg M. <bli...@us...> - 2008-08-23 02:55:35
|
Update of /cvsroot/phpwebsite-comm/modules/mailinglists/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23205/class Modified Files: Email.php Log Message: Emails are now templated. Index: Email.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/mailinglists/class/Email.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Email.php 23 Aug 2008 01:49:37 -0000 1.3 --- Email.php 23 Aug 2008 02:55:12 -0000 1.4 *************** *** 311,314 **** --- 311,317 ---- } + $tpl_text['MESSAGE'] = $this->getMsgText(); + $tpl_html['MESSAGE'] = $this->getMsgHtml(); + if (PHPWS_Settings::get('mailinglists', 'footer')) { *************** *** 319,344 **** $url .= PHPWS_Text::linkAddress('mailinglists', $vars, false, false, false); ! $footer_text = str_replace('[URL]', $url, ! PHPWS_Text::decodeText(PHPWS_Settings::get('mailinglists', 'footer_text_msg'))); ! $footer_html = str_replace('[URL]', $url, ! PHPWS_Text::parseOutput(PHPWS_Settings::get('mailinglists', 'footer_html_msg'))); ! $mail->setMessageBody($this->getMsgText() . "\n" . $footer_text); ! /* Only set the HTML message if the subscriber has requested HTML. */ ! if ($subscriber->getHtml(false)) ! { ! $mail->setHTMLBody($this->getMsgHtml() . $footer_html); ! } ! } ! else { ! $mail->setMessageBody($this->getMsgText()); ! ! /* Only set the HTML message if the subscriber has requested HTML. */ ! if ($subscriber->getHtml(false)) ! { ! $mail->setHTMLBody($this->getMsgHtml()); ! } } } --- 322,337 ---- $url .= PHPWS_Text::linkAddress('mailinglists', $vars, false, false, false); ! $tpl_text['FOOTER'] = str_replace('[URL]', $url, ! PHPWS_Text::decodeText(PHPWS_Settings::get('mailinglists', 'footer_text_msg'))); ! $tpl_html['FOOTER'] = str_replace('[URL]', $url, ! PHPWS_Text::parseOutput(PHPWS_Settings::get('mailinglists', 'footer_html_msg'))); ! } ! $mail->setMessageBody(PHPWS_Template::process($tpl_text, 'mailinglists', 'email/send_text.tpl')); ! /* Only set the HTML message if the subscriber has requested HTML. */ ! if ($subscriber->getHtml(false)) { ! $mail->setHTMLBody(PHPWS_Template::process($tpl_html, 'mailinglists', 'email/send_html.tpl')); } } |