Simon> May I suggest another way to do things? ...a template class that
directly
Simon> reads templates from the database...
Yes, absolutely, and I appreciate that you did! Especially since my
initial excitement gave way... The little [% variable | eval %] trick
broke down when I tried splicing it into the Mail plugin -- bummer. (I
do like to use simple solutions where they apply. Easy to maintain.)
But none of the variations I tried did much good, example:
[% query = DBI.prepare('SELECT * FROM email WHERE emailid = ?') %]
[% FOREACH email_tpl = query.execute('1') %]
[% SET body = email_tpl.body | eval %]
[% ...other Mail stuff... %]
[% Mail.Body(body) %]
[% END %]
And don't even think about doing something silly like this:
[% Mail.Body(body | eval) %]
So I am very interested in looking into this.
I will give the template class code you sent a thorough going over.
Just a couple quick questions. I see mention of a _compile function. Is
that a routine
from Feuilleton::View, or Database::Template, or some other? I assume
_compile is where the variables would be populated?
Also, I tried googling for Feuilleton::View, and got zero hits. Google on
Feuilleton gets a lot of French pages, but nothing I recognized. CPAN
search
thinks Feuilleton must be related to XML-EasySQL-1.2 (author Curtis Lee
Fulton :)
/dennis
By the way, Simon, I really like what I've read about Maypole. I plan to
dig in and start
using it on my next project.
---------------------------------------------------------------------------
Office phone: 317.892.2241
---------------------------------------------------------------------------
This tagline is identical to the one you are reading.
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates