Nico Edtinger
2007-11-09 14:05:58 UTC
I would like to use SMARTY to build my email messages. Can I?
Could someone give me an example of code?
As long as you only want the body in a smarty template it's quite easy:Could someone give me an example of code?
<?php
$mail = new Zend_Mail();
$tpl = new Smarty();
$tpl->assign($vars);
$mail->setBodyText($tpl->fetch('mail.tpl'));
$mail->setFrom('foo-***@public.gmane.org', 'Example');
$mail->setSubject('Test');
$mail->addTo('bar-***@public.gmane.org', 'example');
$mail->send();
?>
nico