logging of template-generated mail, #12809
[freeside.git] / httemplate / misc / email-customers.html
index 0ec8bb9..97ad8d8 100644 (file)
@@ -29,6 +29,7 @@
 % if ( $cgi->param('action') ) {
 
     <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
+    <INPUT TYPE="hidden" NAME="msgnum" VALUE="<% $cgi->param('msgnum') %>">
 
 %   if ( $msg_template ) {
       <% include('/elements/tr-fixed.html',
@@ -185,7 +186,7 @@ if ( $cgi->param('action') eq 'preview' ) {
     $sql_query->{'extra_sql'} .= ' LIMIT 1';
     $sql_query->{'order_by'} = '';
     my $cust = qsearchs($sql_query)->cust_main;
-    my %message = $msg_template->prepare( 'cust_main' => $cust );
+    my %message = $msg_template->prepare( 'cust_main' => $cust, 'preview' => 1 );
     ($from, $subject, $html_body) = @message{'from', 'subject', 'html_body'};
   }
 }