Roderick A. Anderson wrote:
Is anyone creating e-mail messages using TT? I have done the body but
with the list of recipients changing and getting longer I thought a
template that constructed the message headers called by a template to
create the body made more sense.
I'm up to messages going to one pager, two cell phones, and RT ( Not
SPAMMING ). Writing , even with a loop , multiple ->datasend( 'To: ' .
"$emailto\n" ) lines is getting to be a pain. I haven't found any modules
that would make this easier and I'm not quite up to writing my own at this
time.
Before taking a chance at re-inventing the wheel I'll ask if I missed this
while searching and if anyone has code and/or ideas to share on it.
You can construct the entire message in a template. Something like:
====== Email Template =======
To: [% to_header %]
From: [% [EMAIL PROTECTED] %]
Subject: WARNING Server Meldown: [% server_name %]
Just to let you know, server [% server_name %] is about
to explode.
Thanks.
====== End Template ==========
Now, you just generate that template into a string and pass it to a
module like Email::Send. For generating the to_header you might want to
use Email::Address (and then joined together with commas).
If your message is any more complicated than that, you might want to use
Email::Simple::Creator to take care of the headers and then generate
only the body from the template.
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates