summaryrefslogtreecommitdiff
path: root/FS/FS/msg_template.pm
diff options
context:
space:
mode:
authormark <mark>2010-08-16 17:49:03 +0000
committermark <mark>2010-08-16 17:49:03 +0000
commit4774ede40353662ddcb4181d824ab2167c68ff8c (patch)
treed38caffb40f573dd82e74be5595576d374508ad0 /FS/FS/msg_template.pm
parent55476aa0484f5ebada5f36e1407722d84609bd34 (diff)
Bcc address for impending recur notices, RT#8953
Diffstat (limited to 'FS/FS/msg_template.pm')
-rw-r--r--FS/FS/msg_template.pm20
1 files changed, 11 insertions, 9 deletions
diff --git a/FS/FS/msg_template.pm b/FS/FS/msg_template.pm
index d1db17d..1217421 100644
--- a/FS/FS/msg_template.pm
+++ b/FS/FS/msg_template.pm
@@ -255,9 +255,10 @@ sub prepare {
my $conf = new FS::Conf;
(
- 'from' => $self->from ||
+ 'from' => $self->from_addr ||
scalar( $conf->config('invoice_from', $cust_main->agentnum) ),
'to' => \@to,
+ 'bcc' => $self->bcc_addr || undef,
'subject' => $subject,
'html_body' => $body,
'text_body' => HTML::FormatText->new(leftmargin => 0, rightmargin => 70
@@ -398,26 +399,27 @@ sub _upgrade_data {
my ($self, %opts) = @_;
my @fixes = (
- [ 'alerter_msgnum', 'alerter_template', '', '' ],
- [ 'cancel_msgnum', 'cancelmessage', 'cancelsubject', '' ],
- [ 'decline_msgnum', 'declinetemplate', '', '' ],
- [ 'impending_recur_msgnum', 'impending_recur_template', '', '' ],
- [ 'payment_receipt_msgnum', 'payment_receipt_email', '', '' ],
- [ 'welcome_msgnum', 'welcome_email', 'welcome_email-subject', 'welcome_email-from' ],
- [ 'warning_msgnum', 'warning_email', 'warning_email-subject', 'warning_email-from' ],
+ [ 'alerter_msgnum', 'alerter_template', '', '', '' ],
+ [ 'cancel_msgnum', 'cancelmessage', 'cancelsubject', '', '' ],
+ [ 'decline_msgnum', 'declinetemplate', '', '', '' ],
+ [ 'impending_recur_msgnum', 'impending_recur_template', '', '', 'impending_recur_bcc' ],
+ [ 'payment_receipt_msgnum', 'payment_receipt_email', '', '', '' ],
+ [ 'welcome_msgnum', 'welcome_email', 'welcome_email-subject', 'welcome_email-from', '' ],
+ [ 'warning_msgnum', 'warning_email', 'warning_email-subject', 'warning_email-from', '' ],
);
my $conf = new FS::Conf;
my @agentnums = ('', map {$_->agentnum} qsearch('agent', {}));
foreach my $agentnum (@agentnums) {
foreach (@fixes) {
- my ($newname, $oldname, $subject, $from) = @$_;
+ my ($newname, $oldname, $subject, $from, $bcc) = @$_;
if ($conf->exists($oldname, $agentnum)) {
my $new = new FS::msg_template({
'msgname' => $oldname,
'agentnum' => $agentnum,
'from_addr' => ($from && $conf->config($from, $agentnum)) ||
$conf->config('invoice_from', $agentnum),
+ 'bcc_addr' => ($bcc && $conf->config($from, $agentnum)) || '',
'subject' => ($subject && $conf->config($subject, $agentnum)) || '',
'mime_type' => 'text/html',
'body' => join('<BR>',$conf->config($oldname, $agentnum)),