Click here to get back home

HTML::Template

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
HTML::Template Wijnand Nijs 03-05-2008
Posted by Wijnand Nijs on March 5, 2008, 2:40 pm
Please log in for more thread options
Hello,

I am using HTML::Template to generate interactive pages for my site. Is
it possibel to use this module to generate (from plaintext and html
templates) to the body (as a var $body) of a mail message?

Something like:

# my $Tmpl = HTML::Template->new(filename => 'templates/html.tmpl');
# $Tmpl->param(
# BOUNDERY => $boundary,
# DATE => $Date,
# TITLE => $Title,
# HTML => $Html,
# );
# print $Tmpl->$Body;
||
Thanks and greetings...
Wijnand Nijs

Posted by John Bokma on March 5, 2008, 3:09 pm
Please log in for more thread options

> Hello,
>
> I am using HTML::Template to generate interactive pages for my site. Is
> it possibel to use this module to generate (from plaintext and html
> templates) to the body (as a var $body) of a mail message?
>
> Something like:
>
> # my $Tmpl = HTML::Template->new(filename => 'templates/html.tmpl');
> # $Tmpl->param(
> # BOUNDERY => $boundary,

^

> # DATE => $Date,
> # TITLE => $Title,
> # HTML => $Html,
> # );
> # print $Tmpl->$Body;

Yes, the process method can store the output in a scalar as
follows:

my $body = '';
$tt->process( 'templates/html.tmpl', $vars, $body )
or die 'Template error: ', $tt->error();

and use MIME::Lite to send the email

(also, I wouldn't recommend to start variable names with caps)

--
John

Arachnids near Coyolillo - part 1
http://johnbokma.com/

Similar ThreadsPosted
HTML::Template and __ODD__ July 22, 2005, 7:48 am
HTML::Template not outputting February 25, 2008, 3:11 pm
Mixing HTML::Template and GD::Graph May 14, 2005, 8:53 am
Namespace for new module: HTML::Template::HTX? May 13, 2005, 7:17 pm
HTML::Template arbitraryily nested recursive loops April 8, 2005, 2:59 pm
HTML::Template, is it possible to nest inside a ? June 4, 2007, 4:58 pm
install HTML::Template - Problem reading cache file / Bad file number July 24, 2004, 7:55 pm
[RFC] HTML::Dashboard (Spreadsheet-like formatting for HTML tables) April 16, 2007, 4:50 pm
Template Toolkit Beautifer September 8, 2006, 2:22 pm
Recall::Template - new module proposal March 14, 2007, 3:21 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap