[%- Mail.from= 'my.sender@ddress'; Mail.subject= 'This is your requested report'; Mail.cc= [ 'someone.in@cc', 'someoneelse@cc', ]; %] here the body comes #### my $vars= { Mail => {}, # additionally my other variables }; my $output= ''; $tt->process( $template, $vars, \$output) or die $tt->error(); # Here I now have: # $vars->{'Mail'}->{'subject'} etc. #### [%- # (String) Name of the main report file Files.defects= 'defect.htm'; # (Hash) additional data files and what to do with asignee # Structure => { 'recipient' => ('to'|'no breach to'|'cc') } Files.datafiles ={ 'File1.csv' => { recipient => 'to' }, 'another.csv' => { recipient => 'no breach to'}, 'More.csv' => { recipient => 'cc' }, }; # (Array) List of all mailtemplate file names Files.templates=[ 'report1.tt', 'report2.tt', ]; # (Hash) List of all known e-mail adresses # Structure: => Users.list={ 'Horst Porst' => 'Horst.Porst@my.do.main', 'Frank Schrank' => 'Frank.Schrank@my.do.main', 'Hans Dampf' => 'Hans.Dampf@my.do.main', 'Ijon Tichy' => 'Ijon.Tichy@my.do.main', }; %] #### my $config_file= 'sendreport.conf'; my $config= { Users => {}, Files => {}, }; $tt->process($config_file, $config) or die $tt->error();