Re: which way to do it

From: Date: Thu, 17 Oct 2002 20:09:28 +0000
Subject: Re: which way to do it
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-120394@lists.php.net to get a copy of this message
Well there's a multitude of ways to do it. I don't think that any particular way is going to be generally better than another. Personally what I would do is store the template as a flat file. This way I can edit the template in Dreamweaver (not as a DW-template, but just as plain HTML/Text) and simply click a button to update on the website. Also instead of some hacked template system searching and replacing the string Firstname="" why not simply use standard PHP variables (ie. $firstname) and then include(); the file into your email script? Use output buffering to get the file into a string. The file will still parse as PHP and you'll skip about 100 lines of uncessary code. These are just a couple of ideas... again may not necessarily be the way that is best for 'you' but this is the way that I would handel it. Hope it helps. -Kevin ----- Original Message ----- From: "Megalion" <php@megandodson.com> To: <php-general@lists.php.net> Sent: Thursday, October 17, 2002 2:06 PM Subject: [PHP] which way to do it > > I need set up the ability to edit email templates that will be used to send email from a site. > > I'm trying to decide the best way to store them so that I can pull them into a <textarea> field for editing or pull into a php string that will be the body of the message to be sent. > > I'm concerned about maintaining line breaks without adding any that aren't meant to be there as it goes into the textarea field and then saved back out to... what? > > Do I store it in a special table in the database or in a flat file? > > When I go to use it to actually send email, I need to process the template for variables to be switched out ie (in psuedocode) > > Hi (FirstName or if FirstName=="", username), > > Recommendations as to the most painless way to handle this would be appreciated! > > Megalion > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#120394) next »