diff options
author | ivan <ivan> | 2010-08-24 00:55:48 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-08-24 00:55:48 +0000 |
commit | 1f979608d9a16baa1c9d91e203d1b4d86b3f1276 (patch) | |
tree | dcf5f5f679753fd371e3c2e97175392aab879d82 | |
parent | 1d0c67ac17b4b8d9256d7ed8192611d808d2be0f (diff) |
fix payment receipts when payment_receipt_msgnum is unconfigured
-rw-r--r-- | FS/FS/cust_pay.pm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index eee263a1d..accc8260f 100644 --- a/FS/FS/cust_pay.pm +++ b/FS/FS/cust_pay.pm @@ -458,12 +458,15 @@ sub send_receipt { my $error = ''; - if( $conf->exists('payment_receipt_msgnum') ) { + if ( $conf->exists('payment_receipt_msgnum') + && $conf->config('payment_receipt_msgnum') + ) + { my $msg_template = FS::msg_template->by_key($conf->config('payment_receipt_msgnum')); $error = $msg_template->send('cust_main'=> $cust_main, 'object'=> $self); - } - elsif ( $conf->exists('payment_receipt_email') ) { + + } elsif ( $conf->exists('payment_receipt_email') ) { my $receipt_template = new Text::Template ( TYPE => 'ARRAY', SOURCE => [ map "$_\n", $conf->config('payment_receipt_email') ], @@ -506,8 +509,7 @@ sub send_receipt { 'body' => [ $receipt_template->fill_in( HASH => \%fill_in ) ], ); - } - else { # no payment_receipt_msgnum or payment_receipt_email + } else { # no payment_receipt_msgnum or payment_receipt_email my $queue = new FS::queue { 'paynum' => $self->paynum, |