From: Mitch Jackson Date: Sun, 28 Jan 2018 23:54:00 +0000 (-0600) Subject: RT# 73421 Fix bug on some "Email customers" report links, docs X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=280c44682a79e586af941e869e7a78ca8f367cf2 RT# 73421 Fix bug on some "Email customers" report links, docs --- diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index b8d8f102f..a82d8a225 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -3033,7 +3033,7 @@ contacts with a matching cust_contact.classnum are returned. When a classnum of 0 is given, contacts with a null classnum are also included. Arguments may also contain the dest flag names 'invoice' or 'message'. -If given, contacts who's invoice_dest and/or invoice_message flags are +If given, contacts who's invoice_dest and/or message_dest flags are not set to 'Y' will be excluded. =cut diff --git a/FS/FS/cust_main_Mixin.pm b/FS/FS/cust_main_Mixin.pm index 169e1eb65..cceaa4bc7 100644 --- a/FS/FS/cust_main_Mixin.pm +++ b/FS/FS/cust_main_Mixin.pm @@ -399,10 +399,10 @@ Text body This field contains a comma-separated list. This list may contain: -- the text "invoice" indicating emails should only be sent to contact_email - addresses with the invoice_dest flag set -- the text "message" indicating emails should only be sent to contact_email - addresses with the message_dest flag set +- the text "invoice" indicating contacts with invoice_dest flag should + be included +- the text "message" indicating contacts with message_dest flag should + be included - numbers representing classnum id values for email contact classes. If any classnum are present, emails should only be sent to contact_email addresses where contact_email.classnum contains one of these classes. diff --git a/FS/FS/msg_template/email.pm b/FS/FS/msg_template/email.pm index 753fd3d69..37c1fab46 100644 --- a/FS/FS/msg_template/email.pm +++ b/FS/FS/msg_template/email.pm @@ -214,14 +214,14 @@ A L (or arrayref of them) to attach to the message. Set a string containing a comma-separated list. This list may contain: -- the text "invoice" indicating emails should only be sent to contact_email - addresses with the invoice_dest flag set -- the text "message" indicating emails should only be sent to contact_email - addresses with the message_dest flag set - - numbers representing classnum id values for email contact classes. - If any classnum are present, emails should only be sent to contact_email - addresses where contact_email.classnum contains one of these classes. - The classnum 0 also includes where contact_email.classnum IS NULL +- the text "invoice" indicating contacts with invoice_dest flag should + be included +- the text "message" indicating contacts with message_dest flag should + be included +- numbers representing classnum id values for email contact classes. + If any classnum are present, emails should only be sent to contact_email + addresses where contact_email.classnum contains one of these classes. + The classnum 0 also includes where contact_email.classnum IS NULL If neither 'invoice' nor 'message' has been specified, this method will behave as if 'invoice' had been selected diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html index 30162506f..0a43a82dd 100755 --- a/httemplate/search/cust_main.html +++ b/httemplate/search/cust_main.html @@ -140,8 +140,14 @@ my $menubar = []; if ( $FS::CurrentUser::CurrentUser->access_right('Bulk send customer notices') ) { + # URI::query_from does not support hashref + # results in: ...&contacts=HASH(0x55e16cb81da8)&... + my %query_hash = %search_hash; + delete $query_hash{contacts} + if exists $query_hash{contacts} && ref $query_hash{contacts}; + my $uri = new URI; - $uri->query_form( \%search_hash ); + $uri->query_form( \%query_hash ); my $query = $uri->query; push @$menubar, emt('Email a notice to these customers') =>