Perobl has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks
I'm trying to create an auto-generated email that will share some data with the recipient. Normally I would pass variables to TT2 using a hash ref and TmplParams:
my $msg = MIME::Lite::TT::HTML -> new( From => 'donotreply@windowsintowaukesha.com', To => $to, Cc => $cc, Subject => 'Bid Strategy System - Final Pricing Approval', Template => { html => 'email_bid_strategy_final_appr.tt', }, TmplOptions => \%options, TmplParams => \%mail_params, );
I can pass most of what I need to pass in %mail_params, however, I'd like to also pass data for a small table. When I pass this to standard HTML, I simply use a HoH.
TT2 EXAMPLE (displaying HoH)
[% FOREACH record IN item_hoh.values.nsort('index') %] <tr class="[% loop.parity %]"> <td>[% record.index %]</td> <td>[% record.mva %]</td> <td>[% record.hv1 %]</td> <td>[% record.hv2 %]</td> <td>[% record.ltc %]</td> <td>[% record.qty %]</td> <tr> [% END %]
I don't think I can pass a HoH using MIME::Lite::TT::HTML.
Can anyone offer me advice for dealing with a hash and a HoH? Thank you.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl CGI and Template Toolkit
by Eliya (Vicar) on Jan 03, 2012 at 20:58 UTC | |
by Perobl (Beadle) on Jan 03, 2012 at 21:20 UTC | |
by Eliya (Vicar) on Jan 03, 2012 at 21:38 UTC | |
by Perobl (Beadle) on Jan 03, 2012 at 21:49 UTC | |
by Eliya (Vicar) on Jan 03, 2012 at 22:47 UTC | |
| |
Re: Perl CGI and Template Toolkit
by Anonymous Monk on Jan 04, 2012 at 12:05 UTC |
Back to
Seekers of Perl Wisdom