Re: [SMARTY] problem with using Smarty as a mail template

From: Date: Fri, 02 Apr 2004 15:46:20 +0000
Subject: Re: [SMARTY] problem with using Smarty as a mail template
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11223@lists.php.net to get a copy of this message
1. you could use html based email so that only when you insert <br /> you will have a newline 2. when you output information to be sent as an email, be careful not to put any newlines that you dont' intend to. For example: ex1: ----- hello there ----- ex2: ----- hello\nthere ----- ex1 and ex2 would be the same thing when sent through email if there was something to change the \n into a newline. This is a common mistake: ex3: ----- hello\n there ----- in ex3 they put a newline in literally for readability and also put a represntation of a newline in thinking that the literal one would be ignored. Thre result in the email would be ex4. ex4: ----- hello there ----- HTH "Trish Hartnett" <trish@novara.ie> wrote: > Hello, > > I have been using Smarty with standard HTML files successfully for a while > now. I'm currently trying to use Smarty as a mail template. It works fine, > but the formatting new empty lines are being inserted all over the place. > > For example the template (.tpl) file I'm using looks like: > " General Information > > 1. Where do I log in to access my account? > 2. What is my username and password ? > > " > > The file produced by Smarty looks like: > " General Information > > > > 1. Where do I log in to access my account? > > 2. What is my username and password ? > " > > Is there anyway to get around this problem of insertion of new lines ? > Thanks in advance for any advice offered. > Best Regards, > Trish.

« previous php.smarty.general (#11223) next »