From: mark Date: Fri, 26 Jun 2009 06:55:07 +0000 (+0000) Subject: Add expiration alerts to freeside-daily routine X-Git-Tag: root_of_svc_elec_features~1090 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=45a4c5ad153a132ab392d71ca7cffbd08ff3c9c2 Add expiration alerts to freeside-daily routine --- diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index ac479da1e..b45cdd797 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -566,11 +566,19 @@ worry that config_items is freeside-specific and icky. }, { + 'key' => 'alert_expiration', + 'section' => 'billing', + 'description' => 'Enable alerts about billing method expiration.', + 'type' => 'checkbox', + 'per_agent' => 1, + }, + + { 'key' => 'alerter_template', 'section' => 'billing', 'description' => 'Template file for billing method expiration alerts. See the billing documentation for details.', 'type' => 'textarea', - 'per-agent' => 1, + 'per_agent' => 1, }, { diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily index acf795087..271c436c6 100755 --- a/FS/bin/freeside-daily +++ b/FS/bin/freeside-daily @@ -3,6 +3,7 @@ use strict; use Getopt::Std; use FS::UID qw(adminsuidsetup); +use FS::Conf; &untaint_argv; #what it sounds like (eww) use vars qw(%opt); @@ -16,7 +17,8 @@ bill(%opt); # Send alerts about upcoming credit card expiration. use FS::Cron::alert_expiration qw(alert_expiration); -alert_expiration(%opt); +my $conf = new FS::Conf; +alert_expiration(%opt) if($conf->exists('alert_expiration')); #what to do about the below when using -m? that is the question.