X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FCron%2Fnotify.pm;h=ece96fcfd81d6a1545bd2adf075fed11e6b5d905;hb=938615d6374c8e868647b88e3aa27c15e942b8ed;hp=5b0e186adf0ba8f9b2c14db4c20cbc8a9e324fad;hpb=7889bec2b0f951c053b06ef45fbc60dacd3f8a88;p=freeside.git diff --git a/FS/FS/Cron/notify.pm b/FS/FS/Cron/notify.pm index 5b0e186ad..ece96fcfd 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' => $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) {