DataObjects/I18n.php
[Pman.Core] / Mailer.php
index 881a9fe..3588ee4 100644 (file)
@@ -171,7 +171,7 @@ class Pman_Core_Mailer {
             // for the html body, we may want to convert the attachments to images.
 //            var_dump($htmlbody);exit;
             
-            if($content->body_cls && strlen($content->body_cls)){
+            if(!empty($content->body_cls) && strlen($content->body_cls)){
                 $htmlbody = $this->htmlbodySetClass($htmlbody, $content->body_cls);
             }
             
@@ -502,8 +502,9 @@ class Pman_Core_Mailer {
         
         $class = $dom->createAttribute('class');
         $class->value = $cls;
-        $body->appendChild($class);
+        $body->item(0)->appendChild($class);
         
+        return $dom->saveHTML();
     }
     
     function fetchImage($url)