// this cannot be primary key because we need that for the auto_increment
// fixed_sort_order field
$sql .= "
- UNIQUE KEY ( activity_id )
+ UNIQUE KEY ( activity_id )
) ENGINE=HEAP DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
";
* @param string $cc cc recipient
* @param string $bcc bcc recipient
* @param array $contactIds contact ids
+ * @param string $additionalDetails the additional information of CC and BCC appended to the activity Details
*
* @return array ( sent, activityId) if any email is sent and activityId
* @access public
$attachments = NULL,
$cc = NULL,
$bcc = NULL,
- $contactIds // FIXME a param with no default shouldn't be last
+ $contactIds, // FIXME a param with no default shouldn't be last
+ $additionalDetails = NULL
) {
// get the contact details of logged in contact, which we set as from email
if ($userID == NULL) {
// CRM-6265: save both text and HTML parts in details (if present)
if ($html and $text) {
- $details = "-ALTERNATIVE ITEM 0-\n$html\n-ALTERNATIVE ITEM 1-\n$text\n-ALTERNATIVE END-\n";
+ $details = "-ALTERNATIVE ITEM 0-\n$html$additionalDetails\n-ALTERNATIVE ITEM 1-\n$text$additionalDetails\n-ALTERNATIVE END-\n";
}
else {
$details = $html ? $html : $text;
+ $details .= $additionalDetails;
}
$activityParams = array(
CONST MAX_EMAILS_KILL_SWITCH = 50;
public $_contactDetails = array();
+ public $_additionalContactDetails = array();
public $_allContactDetails = array();
public $_toContactEmails = array();
'name' => $name,
'id' => $matches[0][$i],
);
+ $id = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Email', $matches[2][$i] , 'contact_id', 'email');
+ $form->_additionalContactDetails[$element][$id] = CRM_Contact_BAO_Contact::displayName($id);
}
-
$var = "{$element}Contact";
$form->assign($var, json_encode($elementValues));
}
$bcc = CRM_Utils_Array::value('bcc_id', $formValues);
$subject = $formValues['subject'];
+
+ // CRM-13378: Append CC and BCC information at the end of Activity Details
+ $elements = array('cc', 'bcc');
+ $additionalDetails = NULL;
+ foreach ($elements as $element) {
+ if (isset($form->_additionalContactDetails[$element])) {
+ foreach ($form->_additionalContactDetails[$element] as $id => $display_name) {
+ $url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&force=1&cid={$id}");
+ $form->_additionalContactDetails[$element][$id] = "<a href=$url>$display_name</a>";
+ }
+ $additionalDetails .= "\n$element : " . implode(", ", $form->_additionalContactDetails[$element]);
+ unset($form->_additionalContactDetails[$element]);
+ }
+ }
+
// CRM-5916: prepend case id hash to CiviCase-originating emails’ subjects
if (isset($form->_caseId) && is_numeric($form->_caseId)) {
$hash = substr(sha1(CIVICRM_SITE_KEY . $form->_caseId), 0, 7);
$attachments,
$cc,
$bcc,
- array_keys($form->_contactDetails)
+ array_keys($form->_contactDetails),
+ $additionalDetails
);
if ($sent) {