osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Extra linebreaks in HTML emails

This is a discussion on Extra linebreaks in HTML emails within the osCMax v2 Features Discussion forums, part of the osCMax v2.0 Forums category; Hi all: I recently installed an osCMax store and when we tried to send emails, we noticed extra linebreaks in ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Features Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 04-24-2007, 05:06 PM
Lurker
 
Join Date: Mar 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
guntersammet
Default Extra linebreaks in HTML emails

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

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);
    }
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.
Hope this helps some other people who experience this problem.
Cheers,

Gunter
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
HTML Emails being sent as plain text or with source showing malcol27 osCMax v1.7 Installation 8 04-25-2005 11:31 PM
No emails being sent swkhost osCMax v1.7 Installation 2 02-20-2005 10:43 AM
HTML in emails Anonymous osCMax v1.7 Discussion 8 12-05-2003 09:09 AM
Right to Left emails.. HOW? eternity575 osCommerce 2.2 Modification Help 0 10-05-2003 03:22 PM
Newsletter / Emails peterb osCommerce 2.2 Modification Help 0 07-01-2003 10:54 AM


All times are GMT -8. The time now is 07:15 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax