RT# 73421 Fix bug on some "Email customers" report links, docs
authorMitch Jackson <mitch@freeside.biz>
Sun, 28 Jan 2018 23:54:00 +0000 (17:54 -0600)
committerMitch Jackson <mitch@freeside.biz>
Sun, 28 Jan 2018 23:54:00 +0000 (17:54 -0600)
FS/FS/cust_main.pm
FS/FS/cust_main_Mixin.pm
FS/FS/msg_template/email.pm
httemplate/search/cust_main.html

index b8d8f10..a82d8a2 100644 (file)
@@ -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
index 169e1eb..cceaa4b 100644 (file)
@@ -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.
index 753fd3d..37c1fab 100644 (file)
@@ -214,14 +214,14 @@ A L<MIME::Entity> (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
index 3016250..0a43a82 100755 (executable)
@@ -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') =>