diff --git a/CRM/Civicase/Hook/ValidateForm/SendBulkEmail.php b/CRM/Civicase/Hook/ValidateForm/SendBulkEmail.php index 5f6ffbeaf..5a3e98f19 100644 --- a/CRM/Civicase/Hook/ValidateForm/SendBulkEmail.php +++ b/CRM/Civicase/Hook/ValidateForm/SendBulkEmail.php @@ -229,7 +229,7 @@ private function getCaseRoleContacts(array $casesContactInfo) { * @param array|int[] $contactIds * Array with contact Ids. */ - private function sendEmailForCase(CRM_Case_Form_Task_Email $form, int $caseId, array $contactIds) { + private function sendEmailForCase(CRM_Case_Form_Task_Email &$form, int $caseId, array $contactIds) { $_GET['caseid'] = $_REQUEST['caseid'] = $caseId; $form->_caseId = $caseId; $form->_contactIds = $contactIds; @@ -246,7 +246,7 @@ private function sendEmailForCase(CRM_Case_Form_Task_Email $form, int $caseId, a } } - $data['values']['Email']['to'] = implode(',', $toContactEmails); + $data['values']['Email']['to'] = $form->_submitValues['to'] = implode(',', $toContactEmails); $form->submit($form->exportValues()); }