in reply to Re: Template Toolkit: Output one template to Sendmail, another to browser?
in thread Template Toolkit: Output one template to Sendmail, another to browser?
I like the sounds of this:
A third parameter may be passed to the process() method to specify a different output location. This value may be one of: ..... a reference to a scalar... to which output/error is appended;
So if I understand this correctly, I can do
And TT will send the output to $email_content instead of to STDOUT. Then I can$template->process($template_file, $vars, $email_content) || die "Template process failed: ", $template->error(), "\n";
Yes?send_html_mail($to, $from, $subject, $email_content);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Template Toolkit: Output one template to Sendmail, another to browser?
by clscott (Friar) on Aug 26, 2007 at 17:33 UTC | |
by punch_card_don (Curate) on Aug 27, 2007 at 01:03 UTC |