MIME::Lite::TT(3pm)

πŸ“¦
version 0.02 Β· 2 versions
  • 0.02 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.02 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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::Lite
  • Template

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