Jump to content



Latest News: (loading..)

- - - - -

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


  • Please log in to reply
7 replies to this topic

#1   nobodyfamous

nobodyfamous
  • Members
  • 83 posts
  • Real Name:Chad Meyers

Posted 09 January 2012 - 08:35 PM

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

nobodyfamous
  • Members
  • 83 posts
  • Real Name:Chad Meyers

Posted 10 January 2012 - 11:32 PM

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

#3   nobodyfamous

nobodyfamous
  • Members
  • 83 posts
  • Real Name:Chad Meyers

Posted 03 February 2012 - 07:15 PM

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

#4   npn2531

npn2531
  • Members
  • 1,055 posts
  • Real Name:Jase
  • Gender:Not Telling

Posted 04 February 2012 - 04:29 AM

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

nobodyfamous
  • Members
  • 83 posts
  • Real Name:Chad Meyers

Posted 08 February 2012 - 02:23 PM

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

npn2531
  • Members
  • 1,055 posts
  • Real Name:Jase
  • Gender:Not Telling

Posted 09 February 2012 - 04:44 AM

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

#7   nobodyfamous

nobodyfamous
  • Members
  • 83 posts
  • Real Name:Chad Meyers

Posted 25 February 2012 - 03:42 PM

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

#8   evagarbo

evagarbo
  • Members
  • 12 posts
  • Real Name:Eva Gustafsson
  • Gender:Female

Posted 20 July 2012 - 03:21 AM

Thank you for this simple fix, instead of deleting the   <br />  I changed it to <p> and now it works in the order update emails as well.