Brought loadEmailTemplate() back to life.
authorRoland Haeder <roland@mxchange.org>
Tue, 7 Apr 2015 21:10:27 +0000 (23:10 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 7 Apr 2015 21:10:27 +0000 (23:10 +0200)
Signed-off-by: Roland H├Ąder <roland@mxchange.org>
inc/classes/interfaces/template/class_CompileableTemplate.php
inc/classes/main/mailer/class_BaseMailer.php
inc/classes/main/template/class_BaseTemplateEngine.php

index 4cdd742..d126568 100644 (file)
@@ -51,6 +51,16 @@ interface CompileableTemplate extends FrameworkInterface {
        function loadCodeTemplate ($template);
 
        /**
+        * Load a specified email template into the engine for later compilation
+        * with other code/web/email templates.
+        *
+        * @param       $template       The email template we shall load which is
+        *                                              located in "html" by default
+        * @return      void
+        */
+       function loadEmailTemplate ($template);
+
+       /**
         * Compile all variables by inserting their respective values
         *
         * @return      void
index 709945e..db07b20 100644 (file)
@@ -52,9 +52,7 @@ class BaseMailer extends BaseFrameworkSystem {
                $templatePrefix = $this->getConfigInstance()->getConfigEntry('email_tpl_' . $templateName);
 
                // Load this email template
-               // @TODO This needs testing/fixes because the deprecated method
-               // loadEmailTemplate() has been removed from interface CompileableTemplate.
-               $this->getTemplateInstance()->loadCodeTemplate($templatePrefix . '_' . $templateName);
+               $this->getTemplateInstance()->loadEmailTemplate($templatePrefix . '_' . $templateName);
        }
 
        /**
index 68be4dc..ed6f5dd 100644 (file)
@@ -1239,6 +1239,21 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
        }
 
        /**
+        * Load a specified email template into the engine
+        *
+        * @param       $template       The email template we shall load which is
+        *                                              located in 'emails' by default
+        * @return      void
+        */
+       public function loadEmailTemplate ($template) {
+               // Set template type
+               $this->setTemplateType($this->getConfigInstance()->getConfigEntry('email_template_type'));
+
+               // Load the special template
+               $this->loadTemplate($template);
+       }
+
+       /**
         * Compiles configuration place-holders in all variables. This 'walks'
         * through the variable group 'general'. It interprets all values from that
         * variables as configuration entries after compiling them.