summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/Conf.pm7
-rw-r--r--FS/FS/cust_bill.pm2
2 files changed, 9 insertions, 0 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 71d9cf417..7a827dc55 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -965,6 +965,13 @@ httemplate/docs/config.html
},
{
+ 'key' => 'emaildecline-exclude',
+ 'section' => 'billing',
+ 'description' => 'List of error messages that should not trigger email decline notices, one per line.',
+ 'type' => 'textarea',
+ },
+
+ {
'key' => 'cancelmessage',
'section' => 'billing',
'description' => 'Template file for cancellation emails.',
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index d5c3b9e92..27c4178d9 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -860,6 +860,8 @@ sub realtime_bop {
if ( !$realtime_bop_decline_quiet && $conf->exists('emaildecline')
&& grep { $_ ne 'POST' } $cust_main->invoicing_list
+ && ! grep { $_ eq $transaction->error_message }
+ $conf->config('emaildecline-exclude')
) {
my @templ = $conf->config('declinetemplate');
my $template = new Text::Template (