Hi Code Masters,
It seems there is not so much documentation around this "MIME::Lite::TT ::HTML" module.
I have a Perl script used to send confirmation emails to customers when they have ordered a gift voucher, part of the script is:
Sample codes in test.html.tt are:
But when it executed, I got the following email:
Any idea? What I really want is a nice formatted HTML email message and attachment.
Thanks in advanced.
It seems there is not so much documentation around this "MIME::Lite::TT ::HTML" module.
I have a Perl script used to send confirmation emails to customers when they have ordered a gift voucher, part of the script is:
Code:
my %params;
$params{sender_name} = "$sender_first_name"."$sender_last_name";
$params{amount} = $gift_amount;
my %options;
$options{INCLUDE_PATH} = 'templates/';
my $msg = MIME::Lite::TT::HTML->new(
From => 'test@test.com',
To => $email,
Subject => 'Gift Voucher From Evergreens Day Spa',
Template => {
html => 'test.html.tt',
},
TmplOptions => \%options,
TmplParams => \%params,
);
# Set our content type properly
$msg->attr("content-type" => "multipart/mixed");
my $path_to_attachment = "vouchers/$ref.pdf";
$msg->attach(
Type => 'application/pdf',
Path => $path_to_attachment,
Filename => 'Gift Voucher.pdf',
Disposition => 'attachment'
);
$msg->send;
Code:
<html> <body> <p>Dear [% sender_name %],</p> <p>This is to confirm your order of $ [% amount %] gift voucher from Evergreens Day Spa. </p> <p>Status: unpaid.</p> <p>Thank you!</p> <p>Yours Sincerely Evergreens Day Spa Team </p> </body> </html>
Code:
Dear EricLin, This is to confirm your order of $ 300 gift voucher from Evergreens Day Spa. Status: unpaid. Thank you! Yours Sincerely Evergreens Day Spa Team Dear EricLin, This is to confirm your order of $ 300 gift voucher from Evergreens Day Spa. Status: unpaid. Thank you! Yours Sincerely Evergreens Day Spa Team
Thanks in advanced.
Comment