Hi all:
I recently installed an osCMax store and when we tried to send emails, we noticed extra linebreaks in the email. It turns out that the editor adds already <br /> tags for linebreaks and then the email class converts linebreaks again to <br> tags. I fixed it by replacing the original add_html function in catalog/admin/includes/classes/email.php with this one
The change checks if there are <br> tags in the submitted email text. If yes, it assumes that it's already formatted and doesn't need to be again. If not, it replaces new lines with <br> tags.Code:function add_html($html, $text = NULL, $images_dir = NULL) { //if there are alredy <br> tags in there, assume it doesn't need any converted ones if(preg_match('/<br\s*\/?>/', $html)){ $this->html = $html; }else{ $this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br>', $html); } $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text); if (isset($images_dir)) $this->find_html_images($images_dir); }
Hope this helps some other people who experience this problem.
Cheers,
Gunter





LinkBack URL
About LinkBacks






Bookmarks