Smarty 2.6.14 Documentation

Page 132

Smarty Class Methods()

Dear {$contact.name}, Welcome and thankyou for signing up as a member of our user group, Click on the link below to login with your user name of '{$contact.login_id}' so you can post in our forums. http://{$smarty.server.SERVER_NAME}/login/ List master Some user group {include file='email_disclaimer.tpl'}

The email_disclaimer.tpl template which uses the {textformat} modifier. {textformat wrap=40} Unless you are named "{$contact.name}", you may read only the "odd numbered words" (every other word beginning with the first) of the message above. If you have violated that, then you hereby owe the sender 10 GBP for each even numbered word you have read {/textformat}

The php script using the PHP mail() [http://php.net/function.mail] function <?php // get contact from database eg using pear or adodb $query = 'select name, email, login_id from contacts where contact_id='.$contact_id; $contact = $db->getRow($sql); $smarty->assign('contact', $contact); mail($contact['email'], 'Subject', $smarty->fetch('email_body.tpl')); ?>

See also {fetch} display(), {eval}, and template_exists().

126


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.