X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Femail-customers.html;h=d26e40298f20686c69b945727375caffb57af2a8;hb=26004f55ce70242d07fc8de51e24439e783e9e49;hp=0ec8bb9dfb985d8be03a0d9be85ce79eaaa76462;hpb=6c9cd1c36adbb9fc950fcf0a0b269fa6f16838a1;p=freeside.git diff --git a/httemplate/misc/email-customers.html b/httemplate/misc/email-customers.html index 0ec8bb9df..d26e40298 100644 --- a/httemplate/misc/email-customers.html +++ b/httemplate/misc/email-customers.html @@ -29,6 +29,7 @@ % if ( $cgi->param('action') ) { + % if ( $msg_template ) { <% include('/elements/tr-fixed.html', @@ -75,7 +76,7 @@ @@ -106,18 +107,22 @@ Template: <% include('/elements/tr-input-text.html', 'field' => 'from', 'label' => 'From:', + 'size' => 50, ) %> <% include('/elements/tr-input-text.html', 'field' => 'subject', 'label' => 'Subject:', + 'size' => 50, ) %> - - + +
Message: <% include('/elements/htmlarea.html', 'field'=>'html_body') %>Message: <& '/elements/htmlarea.html', + 'field' => 'html_body', + 'width' => 600 &>
@@ -159,7 +164,7 @@ else { @search{keys %search} = map { /\0/ ? [ split /\0/, $_ ] : $_ } values %search; } -my $title = 'Send bulk customer notices'; +my $title = 'Send customer notices'; my $num_cust; my $from = $cgi->param('from') || ''; @@ -183,9 +188,14 @@ if ( $cgi->param('action') eq 'preview' ) { { msgnum => $cgi->param('msgnum') } ) or die "template not found: ".$cgi->param('msgnum'); $sql_query->{'extra_sql'} .= ' LIMIT 1'; + $sql_query->{'select'} = "$table.*"; $sql_query->{'order_by'} = ''; - my $cust = qsearchs($sql_query)->cust_main; - my %message = $msg_template->prepare( 'cust_main' => $cust ); + my $object = qsearchs($sql_query); + my $cust = $object->cust_main; + my %message = $msg_template->prepare( + 'cust_main' => $cust, + 'object' => $object + ); ($from, $subject, $html_body) = @message{'from', 'subject', 'html_body'}; } }