Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

help with newsletter and send mail (extra br's)


nobodyfamous

Recommended Posts

I am having trouble tracking the process of sending mail from the newsletter and send mail tools.

 

The emails are being sent with extra br tags.

 

I have already removed a few nl2br's but still am getting the extra lines.

 

The messages are being generated in CKEditor, in osc2.3.1

 

everything works, but I can't find where the extra br tags are coming from. Any help would be appreciated.

Link to comment
Share on other sites

  • 4 weeks later...

This behavior is set in two files. See catalog/includes/classes/mime.php and catalog/classes/mail.php. Search for "EMAIL_LINEFEED" . look at the definition of the variable of $this->lf it's either "\r\n" or "\n" ;

 

This has been rewritten in the updates for 2.3 Two contributions are also available that have changed this so that the html is email without those extra breaks. "Mailbeez" and "mail manager".

 

You can also fix that issue with this simple hack. Create your email piece as separate webpage using your desired web editor. When you have the email looking like you want it, do the following:

 

1) In your web editor back space at the end of each line, header included, so that your mail piece is in on one single really long line of html code. It should still look the same online.

2) Then cut and paste that single line into the newsletter manager. Viola, no extra breaks.

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

thanks a ton npn2531! You pointed me in the right direction. here si the fix

 

in catalog/admin/includes/classes/email.php around line 160 find

   function add_html($html, $text = NULL, $images_dir = NULL) {
  $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);

and change to this

   function add_html($html, $text = NULL, $images_dir = NULL) {
  // $this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br />', $html);
  $this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '', $html);
  $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);

 

No more extra <br /> when using the ckEditor to build Newsletters and send email from the admin area!!!

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...