Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Remove <br /> line breaks from emails Rate Topic   - - - - -

 
  • japanexp
  • Advanced Member
  • Members
  • Join Date: 02-Nov 13
  • 130 posts

Posted 22 November 2013 - 09:13 PM #1

Hi, it appears that line breaks in customer communications are all turned into <br /> HTML tags. What arrives on the customer side looks horrific. How can the line breaks be preserved properly?

Thanks


Hello,

This is a notification of a new message relating to Order: #1

Name: Tom
Message:
Hello,<br /> <br /> thank you for your order. As the product description states, this product is not available to customers in the United States of America.<br /> <br />We apologise for any inconvenience caused. <br /> <br /> Regards<br /> <br /> Tom

View:
http://www.server.co...ails&order_id=1

 
  • zeero6
  • Senior Member
  • Members
  • Join Date: 25-Jan 07
  • 649 posts

Posted 22 November 2013 - 09:43 PM #2

Did you try this?
http://forum.cs-cart...__verfilter__78

Version 4.9.3 SP1


 
  • japanexp
  • Advanced Member
  • Members
  • Join Date: 02-Nov 13
  • 130 posts

Posted 23 November 2013 - 07:07 AM #3

Hi, thanks. Yes, could be related so I will check it out.

I have found this

http://forum.cs-cart...__fromsearch__1

but I cannot find which file to change. The places that I found replace:"\n":"<br /> are all add-ons, not core files. Not sure where to look.

./design/themes/basic/mail/templates/addons/social_buttons/mail.tpl:{$send_data.notes|replace:"\n":"<br />"}
./design/themes/basic/templates/addons/social_buttons/providers/email.tpl: {if $send_data.notes}
./design/themes/basic/templates/addons/social_buttons/providers/email.tpl: {$send_data.notes}
./product_inquiry_v40x/var/themes_repository/basic/mail/templates/addons/1clue_product_inquiry/mail.tpl:{$send_data.notes|nl2br}
./var/themes_repository/basic/mail/templates/addons/social_buttons/mail.tpl:{$send_data.notes|replace:"\n":"<br />"}
./var/themes_repository/basic/templates/addons/social_buttons/providers/email.tpl: {if $send_data.notes}
./var/themes_repository/basic/templates/addons/social_buttons/providers/email.tpl: {$send_data.notes}

 
  • japanexp
  • Advanced Member
  • Members
  • Join Date: 02-Nov 13
  • 130 posts

Posted 23 November 2013 - 07:26 AM #4

I think I found it, thanks to your link about nl2br expression.

./design/themes/basic/mail/templates/addons/discussion/notification.tpl:

Contains this:

{if $post_data.message}
<b>{__("message")}</b>:<br />
{$post_data.message|nl2br}
<br /><br />
{/if}

I will try tweaking this later and report back.

 
  • zeero6
  • Senior Member
  • Members
  • Join Date: 25-Jan 07
  • 649 posts

Posted 23 November 2013 - 04:02 PM #5

Did you change the 2 locations? That fixed it for me on the invoice notes
design/themes/basic/mail/templates/orders/invoice.tpl

and

design/backend/mail/templates/orders/invoice.tpl

Version 4.9.3 SP1


 
  • japanexp
  • Advanced Member
  • Members
  • Join Date: 02-Nov 13
  • 130 posts

Posted 25 November 2013 - 08:07 AM #6

No effect, at least not on the email body text, I did not check invoice text.

 
  • japanexp
  • Advanced Member
  • Members
  • Join Date: 02-Nov 13
  • 130 posts

Posted 29 November 2013 - 09:45 AM #7

Did you change the 2 locations? That fixed it for me on the invoice notes
design/themes/basic/mail/templates/orders/invoice.tpl

and

design/backend/mail/templates/orders/invoice.tpl


Hi, not sure what I have done differently this time, but it worked, for invoices changing the files above, and for email notification changing design/themes/basic/mail/templates/addons/discussion/notification.tpl

I am not now looking for the relevant files for shipments.

Many thanks!!

 
  • japanexp
  • Advanced Member
  • Members
  • Join Date: 02-Nov 13
  • 130 posts

Posted 29 November 2013 - 10:07 AM #8

design/backend/mail/templates/orders/print_packing_slip.tpl

for shipping

hallelujah, finally I fixed this. Many thanks for helping me here!!

 
  • zeero6
  • Senior Member
  • Members
  • Join Date: 25-Jan 07
  • 649 posts

Posted 29 November 2013 - 06:31 PM #9

You welcome.

Version 4.9.3 SP1


 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1244 posts

Posted 30 November 2013 - 10:43 AM #10

On 4.x you need to use nofilter and can be used like this
{$post_data.message|nl2br nofilter}

i found the issue on addon form_builder but i see the issue appear also in other places

I hope that helps,

---
Valentin
part of hungryweb.net