diff options
author | mark <mark> | 2010-08-16 17:49:03 +0000 |
---|---|---|
committer | mark <mark> | 2010-08-16 17:49:03 +0000 |
commit | 4774ede40353662ddcb4181d824ab2167c68ff8c (patch) | |
tree | d38caffb40f573dd82e74be5595576d374508ad0 /FS/FS/Misc.pm | |
parent | 55476aa0484f5ebada5f36e1407722d84609bd34 (diff) |
Bcc address for impending recur notices, RT#8953
Diffstat (limited to 'FS/FS/Misc.pm')
-rw-r--r-- | FS/FS/Misc.pm | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/FS/FS/Misc.pm b/FS/FS/Misc.pm index 3b0616a..0e8d92b 100644 --- a/FS/FS/Misc.pm +++ b/FS/FS/Misc.pm @@ -113,7 +113,7 @@ sub send_email { # join("\n", map { " $_: ". $options{$_} } keys %options ). "\n" } - my $to = ref($options{to}) ? join(', ', @{ $options{to} } ) : $options{to}; + my @to = ref($options{to}) ? @{ $options{to} } : ( $options{to} ); my @mimeargs = (); my @mimeparts = (); @@ -172,7 +172,7 @@ sub send_email { my $message = MIME::Entity->build( 'From' => $options{'from'}, - 'To' => $to, + 'To' => join(', ', @to), 'Sender' => $options{'from'}, 'Reply-To' => $options{'from'}, 'Date' => time2str("%a, %d %b %Y %X %z", time), @@ -232,8 +232,11 @@ sub send_email { $transport = Email::Sender::Transport::SMTP->new( %smtp_opt ); } + push @to, $options{bcc} if defined($options{bcc}); local $@; # just in case - eval { sendmail($message, { transport => $transport }) }; + eval { sendmail($message, { transport => $transport, + from => $options{from}, + to => \@to }) }; if(ref($@) and $@->isa('Email::Sender::Failure')) { return ($@->code ? $@->code.' ' : '').$@->message @@ -257,6 +260,10 @@ Sender address, required Recipient address, required +=item bcc + +Blind copy address, optional + =item subject email subject, required @@ -290,6 +297,7 @@ sub generate_email { my %return = ( 'from' => $args{'from'}, 'to' => $args{'to'}, + 'bcc' => $args{'bcc'}, 'subject' => $args{'subject'}, ); |