From: Alan Date: Thu, 19 Jan 2023 05:29:11 +0000 (+0800) Subject: fix templatedir X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=4f08a4e647f7e83777b126e64c933d1ef485fb99 fix templatedir --- diff --git a/Mailer.php b/Mailer.php index 38688843..37aed9df 100644 --- a/Mailer.php +++ b/Mailer.php @@ -137,16 +137,23 @@ class Pman_Core_Mailer { 'site_prefix' => false, 'multiSource' => true, ); - if (!empty($this->templateDir)) { - $tmp_opts['templateDir'] = $this->templateDir; - } + $fopts = HTML_FlexyFramework::get()->HTML_Template_Flexy; + + //print_R($fopts);exit; if (!empty($fopts['DB_DataObject_translator'])) { $tmp_opts['DB_DataObject_translator'] = $fopts['DB_DataObject_translator']; } if (!empty($fopts['locale'])) { $tmp_opts['locale'] = $fopts['locale']; } + if (!empty($fopts['templateDir'])) { + $tmp_opts['templateDir'] = $fopts['templateDir']; + } + // override. + if (!empty($this->templateDir)) { + $tmp_opts['templateDir'] = $this->templateDir; + } // local opt's overwrite if (!empty($this->locale)) { @@ -189,12 +196,13 @@ class Pman_Core_Mailer { } $tmp_opts['nonHTML'] = true; + //$tmp_opts['debug'] = true; - - //print_R($tmp_opts); + // print_R($tmp_opts); // $tmp_opts['force'] = true; $template = new HTML_Template_Flexy( $tmp_opts ); + $template->compile('mail/'. $templateFile.'.txt'); /* use variables from this object to ouput data. */