X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Problem with text emails when HTML email is on... (https://forum.x-cart.com/showthread.php?t=1186)

dpumphrey 01-14-2003 06:49 PM

Problem with text emails when HTML email is on...
 
I have been baffling with this one for a while and will probably take a look at it soon if a fix is not available for it. I've searched on "HTML email", but haven't found any related articles on this forum regarding it...

Basically if I select to enable HTML email ( I want my newsletters to go out in HTML) and then modify my profile I get the following formatted email:

Dear Daniel! Your profile has been modified. Your profile: --------------------- Username: dpumphrey First Name: Daniel Last Name: Pumphrey Billing Address: Address: XXXXXXXX City: Indianapolis State: Indiana Country: United States Zip code: XXXXX Shipping Address: Address: XXXXXCity: Indianapolis State: Indiana Country: United States Zip code: XXXX Phone: XXXXXX Fax: E-Mail: XXXXXXX URL: -- Thank you for using X-Cart shopping system Phone: (317) XXXXFax: (317) XXXX URL: www.WilsonCreekDesigns.com

If I disable HTML email then the email comes formatted as such:

Dear Daniel!

Your profile has been modified.

Your profile:
---------------------
Username: dpumphrey

First Name: Daniel
Last Name: Pumphrey

Billing Address:
Address: XXXXX
City: Indianapolis
State: Indiana
Country: United States
Zip code: XXXXX
Shipping Address:
Address: XXXXX
City: Indianapolis
State: Indiana
Country: United States
Zip code: XXXX
Phone: XXXXXX
Fax:
E-Mail: XXXXXX
URL:


--
Thank you for using
X-Cart shopping system

Phone: XXXXX
Fax: XXXXXX
URL: www.WilsonCreekDesigns.com


The content of the email is a smarty template in /mail/profile_modified.tpl - I'm not real familair with this smarty stuff yet, but some pseudo PHP code would go like the following:

If HTML_ENABLED = TRUE Then
CrLf = "
" 'could be

or any other html code
Else
CrLf = vbCrLf ' whatever the php equiv would be - I come from an ASP world
End If

and then you place the $CrLf variable at the end of each line in the PHP code so that the proper new line characters are sent based on the email format selected.

Obviously this is not valid PHP code, but I will be more than happy to post my fix if I do not find one and others are frustrated with the same problem as I.

I have checked the email sent with several different email programs (outlook, outlook express, netscape mail, neomail, horde mail) with the same results so I'm pretty sure it is not a mail client problem.

shan 01-15-2003 03:44 AM

you would need to go in and add html formatting to the email files im afraid for them to work this way.

eleven 02-27-2003 11:10 AM

Solution?
 
Has anyone figured out a solution to this problem other than adding the html into the text? That method doesn't work for every email. For example the first line of an order confirmation is "Dear Name" which is not text that can be changed through the admin section.

funkydunk 03-01-2003 10:34 AM

Have you tried using the php code:

nl2br($variable);

where it picks up the line returns (\n) from the non html emails and converts them to a
hence new line 2 br.

Haven't though about how you would integerate this in yet... :wink:

kpriest 05-05-2003 10:06 AM

I have the same problem - no line breaks in any of the emails. I haven't seen a clear solution posted - why in the world would this not be considered a bug?? Who would conceivably want their emails formatted as a continuos line?

Has anyone resolved with an easy fix??

eleven 05-05-2003 10:09 AM

I ended up replacing every "\n" with a "
"

kpriest 05-05-2003 10:13 AM

You mean in all the email TPL files?

eleven 05-05-2003 11:40 AM

yep. it's not that hard if you do a global find and replace. Or you could use funkydunk's solution above.

funkydunk 05-05-2003 11:35 PM

my above solution wont work. sorry.

however, you can do a similar thing within smarty:

Code:

{$articleTitle|nl2br}

this will convert all /n to


All times are GMT -8. The time now is 10:05 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.