From 4774ede40353662ddcb4181d824ab2167c68ff8c Mon Sep 17 00:00:00 2001 From: mark Date: Mon, 16 Aug 2010 17:49:03 +0000 Subject: Bcc address for impending recur notices, RT#8953 --- FS/FS/msg_template.pm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'FS/FS/msg_template.pm') 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('
',$conf->config($oldname, $agentnum)), -- cgit v1.1