summaryrefslogtreecommitdiff
path: root/FS/FS/cust_main_Mixin.pm
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2017-08-16 10:55:56 -0400
committerChristopher Burger <burgerc@freeside.biz>2018-06-12 13:45:43 -0400
commit91681d4c4832030a86e8565d7ec2c46c94eebc8d (patch)
tree4ea3db78c3dda8344ca169a82fd1b3e5c7be16ca /FS/FS/cust_main_Mixin.pm
parent42b35cdaeb0643630eda0513556a8e668fbcb8e2 (diff)
RT# 73964 - Added biling event action to send an email to phone nunber, and updated email a notice to customer to allow emailing to phone number for email_to_voice service.
Diffstat (limited to 'FS/FS/cust_main_Mixin.pm')
-rw-r--r--FS/FS/cust_main_Mixin.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/FS/FS/cust_main_Mixin.pm b/FS/FS/cust_main_Mixin.pm
index f8f1173..7eeb9c9 100644
--- a/FS/FS/cust_main_Mixin.pm
+++ b/FS/FS/cust_main_Mixin.pm
@@ -408,14 +408,21 @@ use Digest::SHA qw(sha1); # for duplicate checking
sub email_search_result {
my($class, $param) = @_;
+ my $conf = FS::Conf->new;
+ my $send_to_domain = $conf->config('send-to-domain');
+
my $msgnum = $param->{msgnum};
my $from = delete $param->{from};
my $subject = delete $param->{subject};
my $html_body = delete $param->{html_body};
my $text_body = delete $param->{text_body};
my $to_contact_classnum = delete $param->{to_contact_classnum};
+ my $emailtovoice_name = delete $param->{emailtovoice_contact};
+
my $error = '';
+ my $to = $emailtovoice_name . '@' . $send_to_domain unless !$emailtovoice_name;
+
my $job = delete $param->{'job'}
or die "email_search_result must run from the job queue.\n";
@@ -476,10 +483,14 @@ sub email_search_result {
next; # unlinked object; nothing else we can do
}
+my %to = {};
+if ($to) { $to{'to'} = $to; }
+
my $cust_msg = $msg_template->prepare(
'cust_main' => $cust_main,
'object' => $obj,
'to_contact_classnum' => $to_contact_classnum,
+ %to,
);
# For non-cust_main searches, we avoid duplicates based on message