So I'm using Template Toolkit to output dynamic web pages. So far so good.
I'm adding a "email me my profile info" button. When clicked on, I want to retrieve the user's profile info from teh db, populate an email template, send it to the user via sendmail, then populate a confirmation template and serve it to the user saying "ths info was just emailed to you...".
So I tried ( in pseudo code):
Where &send_mail_html contacins, among other things, the usual:$vars = { image_path => $image_path, data => \%data, }; $subject = "contact info"; $template_file = 'contact_info_email.htm'; $template_1->process($template_file, $vars) || die "Template process failed: ", $template->error(), "\n"; &send_mail_html($email, $from_address, $subject, $template_1); $template_file = 'confirm_contact_info_email.htm'; $template->process($template_file, $vars) || die "Template process failed: ", $template->error(), "\n";
And it almost works. The user gets an email, and a confirmation page. But with two problems:$to_address = $_[0]; $from = $_[1]; $subject = $_[2]; $content = $_[3]; ..... print MAIL "To: print MAIL "From: $from\n"; print MAIL "Subject: $subject\n"; print MAIL "$content\n";
So, I'm clearly doing somethign wrong. How should I be doing this?
Thanks.
In reply to Template Toolkit: Output one template to Sendmail, another to browser? by punch_card_don
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |