khudgins has asked for the wisdom of the Perl Monks concerning the following question:
I'm working on the final bits of a new web store application for my employer, and I've run into a bit of a pickle. We need to send the customer an email receipt for their order, and we'd like to send them a nicely formatted table of the items in their cart.
I can't use HTML, as there's a company policy decision stating that we don't put HTML in emails. (I agree - I read much email via PINE myself, and I hate HTML in my inbox). Therefore, format is the way to go. I think.
My question is, how do I make a format against a loop? I'm pulling the data from my database, and it's all working fine in HTML::Template. So I get:
$sqlString = "SELECT * FROM CartItems WHERE txtSessId = ?"; $sth = $dbh->prepare($sqlString); $sth->execute($session) $cartItemsRef = $sth->fetchall_arrayref({});
for a great return set for a TMPL_LOOP in my HTML templates. I can't format those well for a text-based table - I've tried. Given a format like this:
format RECEIPT = Item Quantity Price -------------------------------------------- @<<<<<<<<<<<<<<<<<<<<< @<<<<< @####.## $vars,$go,$here .
How do I loop this on the $cartItemsRef? I don't understand the format system deeply enough to do this.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Format question...
by Hofmator (Curate) on Jan 07, 2003 at 19:41 UTC | |
Re: Format question...
by pfaut (Priest) on Jan 07, 2003 at 19:36 UTC | |
Re: Format question...
by krujos (Curate) on Jan 07, 2003 at 19:32 UTC | |
Re: Format question...
by Mr. Muskrat (Canon) on Jan 07, 2003 at 19:50 UTC | |
by khudgins (Sexton) on Jan 07, 2003 at 20:01 UTC |