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.
In reply to Perl CGI and Template Toolkit by Perobl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |