in reply to Re: Templating emails
in thread Templating emails

If you've got some specific issues you've come across that lead you to think you can't use it it might help to enumerate on those

I'd missed that Template could output to somewhere other than STDOUT! Having gone back and looked at the documentation, I see what I had missed!

Is something like this the right way to do it (untested):

my $mail; $template->process('mail.tt', $vars, \$mail) || die "Template problem! +"; my $mime = MIME::Lite->new( From => 'abc@xyz.com', To => 'you@yours.com', Subject => 'Test', Type => 'text/html', Date => $mail, ); $mime->send;
Or does it need something more than that - other than error checking and validation of course.

Replies are listed 'Best First'.
Re^3: Templating emails
by Fletch (Bishop) on Jul 02, 2021 at 18:19 UTC

    ITYM Data not Date, but yup that's heading the right direction. For some reason I tend to initialize a target buffer with an empty string my $mail = q{} (which may be cargo culting or just strange ingrained habit), and I'd include $template->error in the message so you've got more to go on.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.