Re: [SMARTY] Re: Smarty way to do email
| From: | Darryl Bleau | Date: | Tue, 14 Jan 2003 21:50:50 +0000 |
| Subject: | Re: [SMARTY] Re: Smarty way to do email | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7180@lists.php.net to get a copy of this message | ||
Ah yes fetch() is the magic_smarty_function() I was looking for! I even read
through that page I don't know what's wrong with me but I missed that.
Yes I need a template for subject and from... at least I think I do. I want
to load variables in there from a site config file. They look something like
this:
<email_from.tpl>
{config_load file="site.cfg"}
{#validEmailFrom#}
<email_subject.tpl>
{config_load file="site.cfg"}
Please verify your {#siteName#} account.
Interesting to note, I tried (just for testing) a file like this:
<email_subject.tpl>
This is a subject
But when I used fetch it came back empty. Is that expected behavior? If I
changed it thusly:
<email_subject.tpl>
{config_load file="site.cfg"}
This is a subject
It worked just fine. Sort of strange, I think.
Darryl Bleau
> Do you really need a template for subject and from?
>
> $body = $smarty->fetch('email.tpl');
>
> mail($email_address, $subject, $body, $from);
>
> On Tue, 2003-01-14 at 01:53, André Rabold wrote:
> > I have done it this way:
>>
> > // Build Subject (assign variables, fetch output, clean up)
> > $smarty->assign("subject", $subject);
> > // [...]
> > $subject = $smarty->fetch("email_subject.tpl"); // get output of
template
> > $smarty->clear_all_assign(); // clear assigned variables
> >
> > Ok for you?
> > André