DataObjects/Person.php
authorAlan Knowles <alan@akbkhome.com>
Sun, 28 Oct 2012 12:29:23 +0000 (20:29 +0800)
committerAlan Knowles <alan@akbkhome.com>
Sun, 28 Oct 2012 12:29:23 +0000 (20:29 +0800)
DataObjects/Person.php

index 3ab74eb..8124d39 100644 (file)
@@ -96,16 +96,29 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
             $tops['templateDir'] = $args['templateDir'];
         }
         
-        require_once 'HTML/Template/Flexy.php';
-        $template = new HTML_Template_Flexy( $tops );
         
-     
-         
         
+        require_once 'HTML/Template/Flexy.php';
+        $template = new HTML_Template_Flexy( $tops );
         $template->compile("mail/$templateFile.txt");
         
         /* use variables from this object to ouput data. */
         $mailtext = $template->bufferedOutputObject($content);
+        
+        // if a html file with the same name exists, use that as the body
+        // I've no idea where this code went, it was here before..
+        if (false !== $template->resolvePath ( "mail/$templateFile.html" )) {
+            $tops['nonHTML'] = false;
+            $template = new HTML_Template_Flexy( $tops );
+            $template->compile("mail/$templateFile.html");
+       
+            $htmlbody = $template->bufferedOutputObject($content);
+            
+            
+        }
+        
+        
+        
         //echo "<PRE>";print_R($mailtext);
         //print_R($mailtext);exit;
         /* With the output try and send an email, using a few tricks in Mail_MimeDecode. */