$mailStatus = ts("A copy of the activity has also been sent to selected contacts(s).");
}
else {
- $this->_relatedContacts = CRM_Activity_BAO_ActivityContact::getNames($activity->id, $assigneeID, TRUE, FALSE);
+ $this->_relatedContacts = CRM_Activity_BAO_ActivityAssignment::getAssigneeNames($activity->id, TRUE, FALSE);
$mailStatus .= ' ' . ts("A copy of the activity has also been sent to assignee contacts(s).");
}
+
//build an associative array with unique email addresses.
- foreach ($params[$val] as $id => $dnc) {
+ foreach ($params[$val] as $key => $value) {
+ if ($val == 'contact_check') {
+ $id = $key;
+ }
+ else {
+ $id = $value;
+ }
+
if (isset($id) && array_key_exists($id, $this->_relatedContacts)) {
//if email already exists in array then append with ', ' another role only otherwise add it to array.
if ($contactDetails = CRM_Utils_Array::value($this->_relatedContacts[$id]['email'], $mailToContacts)) {