Yasuhiro Horiuchi > MIME-Lite-TT-0.02 > MIME::Lite::TT

Download:
MIME-Lite-TT-0.02.tar.gz

Dependencies

Annotate this POD

Related Modules

MIME::Lite
IO::Handle
Apache::Request
CGI::Carp
MIME::Base64
Mail::Sender
more...
By perlmonks.org
View/Report Bugs
Module Version: 0.02   Source  

NAME ^

MIME::Lite::TT - TT enabled MIME::Lite wrapper

SYNOPSIS ^

  use MIME::Lite::TT;

  my $msg = MIME::Lite::TT->new(
              From => 'me@myhost.com',
              To => 'you@yourhost.com',
              Subject => 'Hi',
              Template => \$template,
              TmplParams => \%params, 
              TmplOptions => \%options,
            );

  $msg->send();

DESCRIPTION ^

MIME::Lite::TT is the wrapper of MIME::Lite which enabled Template::Toolkit as a template of email.

ADITIONAL OPTIONS ^

Template

The same value passed to the 1st argument of the process method of Template::Toolkit is set to this option.

TmplParams

The parameter of a template is set to this option. This parameter must be the reference of hash.

TmplOptions

configuration of Template::Toolkit is set to this option. ABSOLUTE and RELATIVE are set to 1 by the default.

TmplUpgrade

template is force upgraded. (means utf-8 flag turns on)

SAMPLE ^

 use MIME::Lite::TT;
 
 my $template = <<TEMPLATE;

 This is template.
 my name is [% name %].
 
 TEMPLATE
 
 my %params = (name => 'horiuchi');
 my %options = (EVAL_PERL=>1);
 
 my $msg = MIME::Lite::TT->new(
             From => 'me@myhost.com',
             To => 'you@yourhost.com',
             Subject => 'hi',
             Template => \$template,
             TmplParams => \%params,
             TmplOptions => \%options,
           );

 $msg->send();

AUTHOR ^

Author <horiuchi@vcube.com>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

MIME::Lite,Template

syntax highlighting: