// 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);
}
*/
}
+ 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();
+ }
+
function fetchImage($url)
{