MIME::Lite::TT(3pm)
π MIME::Lite::TT β the manual page, bestie edition π
okay so this is MIME::Lite::TT(3pm), from the User Contributed Perl Documentation section of the manual. sit down, grab a strawberry π, and let me tell you about the cutest little email wrapper you ever did see.
β¨ NAME β¨
MIME::Lite::TT β a MIME::Lite wrapper that's TT enabled π
β¨ 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();
like. that's it. that's the whole vibe. build it, send it, slay. π
β¨ DESCRIPTION β¨
MIME::Lite::TT is the wrapper of MIME::Lite β but here's the thing β it's the one that enabled Template::Toolkit as a template of email. so your emails get to be cute and dynamic. it's giving main character energy, no cap. π¦
β¨ ADITIONAL OPTIONS β¨
(yes bestie, that's how it's spelled in the original, I am NOT touching it, it's iconic now π)
πΈ Template
whatever value you'd pass to the 1st argument of the process method of Template::Toolkit? that exact same value goes here. same value, no changes, periodt.
πΈ TmplParams
the parameter of a template. this is where your template's lil variables live. > β οΈ it must be a reference of hash β like \%params. don't try anything else, she will not accept it.
πΈ TmplOptions
the configuration of Template::Toolkit goes right here. and lowkey? ABSOLUTE and RELATIVE are set to 1 by the default β they come pre-slaying, you don't have to do a thing. β¨
πΈ TmplUpgrade
template is force upgraded. (which means the utf-8 flag turns on π₯). that's the whole thing, that's all it does. she's a simple girl.
β¨ SAMPLE β¨
here's a full lil example so you can see it in the wild, bestie:
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();
see how the template has [% name %] in it and then name => 'horiuchi' shows up in %params? that's the magic. the template and the params are married. iykyk. π
β¨ 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::LiteTemplate
go read those too, they're the parents of this whole situation. π
and that's the whole page!! π this was MIME::Lite::TT, from perl v5.34.0, dated 2022-06-15. now go send somebody a template-driven email, bestie, you're gonna ate. πβ¨π
π¦ where this page comes from
- debian bookworm: libmime-lite-tt-perl 0.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmime-lite-tt-perl 0.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmime-lite-tt-perl 0.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmime-lite-tt-perl 0.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmime-lite-tt-perl 0.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms