Just wondering if it would acctually be possible to set up template files for emails? I am using Smarty and PHPMailer (both latest versions)
Here is my idea, but I'm not quite sure where to go next
Template file
Hello {$user}
Please click on this link to activate your account:
{$link}
Thank you, if you have any questions or this link does not work,
please send an email with your question to {$email}
or go to the contact page ( {$contact_link} )
See you on the boards soon,
camowel
<?php
// Set up the two classes
require_once('config.php'); // $site
require_once('mailsetup.php'); // $mail
require_once('smartysetup.php'); // $smarty
function smartymail($file) {
// somehow get the smarty file parsed and into the mail's body
}
$smarty->assign('link', $site['root'].'/activate.php?ID='.urlencode($ID));
$smarty->assign('contact_link', 'contact.php?s='.urlencode('Activation Email'));
$smarty->assign('user', $username);
$smarty->assign('email', $site['admin_mail']);
$mail->Subject = 'Please activate your account';
$mail->AltBody = smartymail('/mail/activate_account.tpl');
$mail->Body = nl2br($mail->AltBody);
$mail->Send();
If anyone thinks its possible please post your ideas for the smartymail() function, if you have an idea different from mine for making this work it would also be greatly appreciated!
Thanks for reading!