//get all required contacts detail.
if (!empty($contactIds)) {
- // get the contact details.
- list($currentContactDetails) = CRM_Utils_Token::getTokenDetails($contactIds, NULL,
- FALSE, FALSE, NULL,
- [],
- 'CRM_Event_BAO_Participant'
- );
- foreach ($currentContactDetails as $contactId => $contactValues) {
- $contactDetails[$contactId] = $contactValues;
- }
+ $contactDetails = civicrm_api3('Contact', 'get', ['id' => ['IN' => $contactIds, 'return' => 'display_name']])['values'];
}
//get all required events detail.
$mail = self::sendTransitionParticipantMail($additionalId,
$participantDetails[$additionalId],
$eventDetails[$participantDetails[$additionalId]['event_id']],
- $contactDetails[$participantDetails[$additionalId]['contact_id']],
+ NULL,
$emailType
);
$mail = self::sendTransitionParticipantMail($participantId,
$participantValues,
$eventDetails[$participantValues['event_id']],
- $contactDetails[$participantValues['contact_id']],
+ NULL,
$emailType
);
}
/**
+ * Do not use this function.
+ *
* Gives required details of contacts in an indexed array format so we
* can iterate in a nice loop and do token evaluation
*
* @param int|null $jobID
* The mailing list jobID - this is a legacy param.
*
+ * @deprecated
+ *
* @return array - e.g [[1 => ['first_name' => 'bob'...], 34 => ['first_name' => 'fred'...]]]
*/
public static function getTokenDetails(
$className = NULL,
$jobID = NULL
) {
-
$params = [];
foreach ($contactIDs as $contactID) {
$params[] = [