From 4f08a4e647f7e83777b126e64c933d1ef485fb99 Mon Sep 17 00:00:00 2001 From: Alan Date: Thu, 19 Jan 2023 13:29:11 +0800 Subject: [PATCH] fix templatedir --- Mailer.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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. */ -- 2.39.2