summaryrefslogtreecommitdiff
path: root/FS/FS/svc_acct.pm
diff options
context:
space:
mode:
Diffstat (limited to 'FS/FS/svc_acct.pm')
-rw-r--r--FS/FS/svc_acct.pm15
1 files changed, 12 insertions, 3 deletions
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm
index 9032e20c1..f73ab82da 100644
--- a/FS/FS/svc_acct.pm
+++ b/FS/FS/svc_acct.pm
@@ -341,11 +341,20 @@ sub insert {
return "queueing job (transaction rolled back): $error";
}
- #welcome email
my $cust_pkg = $self->cust_svc->cust_pkg;
- my( $cust_main, $to ) = ( '', '' );
+ my $cust_main = $cust_pkg->cust_main;
+
+ my $cust_pkg = $self->cust_svc->cust_pkg;
+
+ if ( $conf->exists('emailinvoiceauto') ) {
+ my @invoicing_list = $cust_main->invoicing_list;
+ push @invoicing_list, $self->email;
+ $cust_main->invoicing_list(@invoicing_list);
+ }
+
+ #welcome email
+ my $to = '';
if ( $welcome_template && $cust_pkg ) {
- my $cust_main = $cust_pkg->cust_main;
my $to = join(', ', grep { $_ ne 'POST' } $cust_main->invoicing_list );
if ( $to ) {
my $wqueue = new FS::queue {