Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Problem with text emails when HTML email is on...

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-14-2003, 06:49 PM
 
dpumphrey dpumphrey is offline
 

Newbie
  
Join Date: Oct 2002
Location: Indianapolis, Indiana USA
Posts: 9
 

Default 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.
__________________
Thanks
Daniel Pumphrey
Wilson Creek Designs
Custom Business and Craft Stamps
Live Site: http://www.WilsonCreekDesigns.com/
Reply With Quote
  #2  
Old 01-15-2003, 03:44 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

you would need to go in and add html formatting to the email files im afraid for them to work this way.
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 02-27-2003, 11:10 AM
 
eleven eleven is offline
 

Senior Member
  
Join Date: Nov 2002
Location: Charlotte, NC, USA
Posts: 118
 

Default 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.
__________________
|| E L E V E N ||
Reply With Quote
  #4  
Old 03-01-2003, 10:34 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

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...
__________________
ex x-cart guru
Reply With Quote
  #5  
Old 05-05-2003, 10:06 AM
  kpriest's Avatar 
kpriest kpriest is offline
 

eXpert
  
Join Date: Apr 2003
Location: Seattle, WA
Posts: 263
 

Default

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??
Reply With Quote
  #6  
Old 05-05-2003, 10:09 AM
 
eleven eleven is offline
 

Senior Member
  
Join Date: Nov 2002
Location: Charlotte, NC, USA
Posts: 118
 

Default

I ended up replacing every "\n" with a "
"
__________________
|| E L E V E N ||
Reply With Quote
  #7  
Old 05-05-2003, 10:13 AM
  kpriest's Avatar 
kpriest kpriest is offline
 

eXpert
  
Join Date: Apr 2003
Location: Seattle, WA
Posts: 263
 

Default

You mean in all the email TPL files?
Reply With Quote
  #8  
Old 05-05-2003, 11:40 AM
 
eleven eleven is offline
 

Senior Member
  
Join Date: Nov 2002
Location: Charlotte, NC, USA
Posts: 118
 

Default

yep. it's not that hard if you do a global find and replace. Or you could use funkydunk's solution above.
__________________
|| E L E V E N ||
Reply With Quote
  #9  
Old 05-05-2003, 11:35 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

my above solution wont work. sorry.

however, you can do a similar thing within smarty:

Code:
{$articleTitle|nl2br}

this will convert all /n to
__________________
ex x-cart guru
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:34 AM.

   

 
X-Cart forums © 2001-2020