diff options
Diffstat (limited to 'FS/FS/Cron/notify.pm')
-rw-r--r-- | FS/FS/Cron/notify.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/FS/FS/Cron/notify.pm b/FS/FS/Cron/notify.pm index 5b0e186ad..74840a6e7 100644 --- a/FS/FS/Cron/notify.pm +++ b/FS/FS/Cron/notify.pm @@ -21,6 +21,8 @@ sub notify_flat_delay { #we're at now now (and later). my($time) = $^T; + my $conf = new FS::Conf; + my $error = ''; my $integer = driver_name =~ /^mysql/ ? 'SIGNED' : 'INTEGER'; @@ -101,14 +103,20 @@ END push @cust_pkgs, $cust_pkg[0]; shift @cust_pkg; } - my $error = - $cust_main->notify( 'impending_recur_template', + my $msgnum = $conf->config('impending_recur_msgnum',$cust_main->agentnum); + if ( $msgnum ) { + my $msg_template = qsearchs('msg_template', { msgnum => $msgnum }); + $error = $msg_template->send($cust_main); + } + else { + $error = $cust_main->notify( 'impending_recur_template', 'extra_fields' => { 'packages' => \@packages, 'recurdates' => \@recurdates, 'package' => $packages[0], 'recurdate' => $recurdates[0], }, ); + } #if $msgnum warn "Error notifying, custnum ". $cust_main->custnum. ": $error" if $error; unless ($error) { |