Page 1 of 1

Mailing html received from a form

Posted: Fri Mar 26, 2010 9:05 am
by ibeaugie
I'm creating a simple order form that has quantity boxes. On submission it goes to the processing php page. I only want it to output tables per prod. category and output <tr>'s and <td>'sfor items that are greater than 0. I have this all fine, as in if I just had the form output the html and tables as needed. I need to know how to take the processed php and use the html with only the necessary data and put it into mail. I know I can't set the php with if's as a variable, so, what's a better option.

-Beau

Re: Mailing html received from a form

Posted: Fri Mar 26, 2010 9:20 am
by Alkis
Take some time to learn a few things about the smarty php template engine: http://www.smarty.net.

by using e.g. $tpl->fetch('template.tpl') you can fetch the contents of a template, after you have applied variables and other stuff. Smarty is a life saver.

After achieving this, do not forget to use full urls on the template and not single web paths, otherwise they want work inside the recipient's mail box.