Sorry for taking a while to reply.
well with smarty templates you can load template file which include some special variables like {$custnam} which refer to name and so on.
these special variables you should define your self in the php side to be able to use in the template
you can define (assign) that variable using the line I mentioned before
PHP Code:
$smarty->assign('custname', $_POST['ename']);
Of course it can be any name you like like customer_name or whatever
after that you can use it in the template like what is mentioned above
say message1.html
HTML Code:
<html>
<body>
<span style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; font-style:normal; font-weight:normal; color:#212121; line-height:14px;">
Dear {$custname},</span>
<b>Welcome to our website.</b>
</body>
after that you can
at last you need to get the parsed version of the data using $smarty->fetch
PHP Code:
$body=$smarty->fetch('message1.html');
you will get in $body variable toe parsed version of the message where {$custname} is replaced with you value in $_POST['ename']
you can always use different messages by fetching different files message1.html, message2.html, and so on
of course you need to create them all before using them
hope I could clarify it.
Last edited by nayes84; 05-17-2010 at 09:09 PM..
|