- if ( $msg_template ) {
- # Now supports other context objects.
- %message = $msg_template->prepare(
- 'cust_main' => $cust_main,
- 'object' => $obj,
- );
- }
- else {
- my @to = $cust_main->invoicing_list_emailonly;
- next if !@to;
-
- %message = (
- 'from' => $from,
- 'to' => \@to,
- 'subject' => $subject,
- 'html_body' => $html_body,
- 'text_body' => $text_body,
- 'custnum' => $cust_main->custnum,
- );
- } #if $msg_template
+ my $cust_msg = $msg_template->prepare(
+ 'cust_main' => $cust_main,
+ 'object' => $obj,
+ );