Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

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


6 replies to this topic

#1 nobodyfamous

  • Community Member
  • 78 posts
  • Real Name:Chad Meyers

Posted 09 January 2012, 20:35

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.

#2 nobodyfamous

  • Community Member
  • 78 posts
  • Real Name:Chad Meyers

Posted 10 January 2012, 23:32

can someone just tell me what files hold what functions/classes for sending mail I can look through them my self

#3 nobodyfamous

  • Community Member
  • 78 posts
  • Real Name:Chad Meyers

Posted 03 February 2012, 19:15

still not getting anywhere on this. Does anyone else have this issue?

#4 npn2531

  • Community Member
  • 951 posts
  • Real Name:Jase
  • Gender:Not Telling

Posted 04 February 2012, 04:29

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.

#5 nobodyfamous

  • Community Member
  • 78 posts
  • Real Name:Chad Meyers

Posted 08 February 2012, 14:23

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!!!

#6 npn2531

  • Community Member
  • 951 posts
  • Real Name:Jase
  • Gender:Not Telling

Posted 09 February 2012, 04:44

I'm going to write your fix down, it is way easier than the convoluted answer I posted.

#7 nobodyfamous

  • Community Member
  • 78 posts
  • Real Name:Chad Meyers

Posted 25 February 2012, 15:42

this has cause 1 issue - when sending out order update emails, everything is on 1 line. so, I need to fix that now. . .