Mailer.php
authoredward <edward@roojs.com>
Mon, 26 Mar 2018 09:11:00 +0000 (17:11 +0800)
committeredward <edward@roojs.com>
Mon, 26 Mar 2018 09:11:00 +0000 (17:11 +0800)
Mailer.php

index 9202b53..cee5d12 100644 (file)
@@ -172,7 +172,7 @@ class Pman_Core_Mailer {
 //            var_dump($htmlbody);exit;
             
             if($content->body_cls && strlen($content->body_cls)){
-                $htmlbody = $this->htmlbodySetClass($htmlbody, $content->body_cls);
+//                $htmlbody = $this->htmlbodySetClass($htmlbody, $content->body_cls);
             }
             
             if ($this->replaceImages) {
@@ -494,17 +494,17 @@ class Pman_Core_Mailer {
     
     function htmlbodySetClass($html, $cls)
     {
-//        $dom = new DOMDocument();
-//        
-//        @$dom->loadHTML('<?xml encoding="UTF-8">' .$html);
-//        
-//        $body = $dom->getElementsByTagName('body');
-//        
-//        $class = $dom->createAttribute('class');
-//        $class->value = $cls;
-//        $body->item(0)->appendChild($class);
-//        
-//        return $dom->saveHTML();
+        $dom = new DOMDocument();
+        
+        @$dom->loadHTML('<?xml encoding="UTF-8">' .$html);
+        
+        $body = $dom->getElementsByTagName('body');
+        
+        $class = $dom->createAttribute('class');
+        $class->value = $cls;
+        $body->item(0)->appendChild($class);
+        
+        return $dom->saveHTML();
     }
     
     function fetchImage($url)