I am currently using something like:
using phplib's template class (thanks freddy!)PHP Code:<?php
include "template.inc";
$to = "to@domain.com";
$from = "from@domain.com";
$t = new Template();
$t->set_file(array(
"email_user" => "email_user.ihtml",
"email_admin" => "email_admin.ihtml"
));
$t->set_var(array(
"to" => "$to",
"from" => "$from"
));
$user_body = $t->parse("MyOutput1","email_user");
$admin_body = $t->parse("MyOutput2","email_admin");
echo $user_body;
echo $admin_body;
?>
anyway, i would much prefere to store these specific templates (they are are for emails and i will have quite a lot of them) in a database, i tried this, replacing email_user.ihtml with $email for example but it does not work, it apparently thinks that $email is the name of the template file as opposed to the actual text i want parsed. Any ideas?





Bookmarks