CRM_Event_PseudoConstant::participantStatus(NULL, "class = 'Negative'"));
$value['status_id'] = $cancelledId;
CRM_Event_BAO_Participant::create($value);
- $domainValues = [];
- $domain = CRM_Core_BAO_Domain::getDomain();
- $tokens = [
- 'domain' =>
- [
- 'name',
- 'phone',
- 'address',
- 'email',
- ],
- 'contact' => CRM_Core_SelectValues::contactTokens(),
- ];
- foreach ($tokens['domain'] as $token) {
- $domainValues[$token] = CRM_Utils_Token::getDomainTokenReplacement($token, $domain);
- }
$participantRoles = CRM_Event_PseudoConstant::participantRole();
$participantDetails = [];
//get the location info
$locParams = ['entity_id' => $this->_event_id, 'entity_table' => 'civicrm_event'];
$eventDetails[$this->_event_id]['location'] = CRM_Core_BAO_Location::getValues($locParams, TRUE);
- //get contact details
- $contactIds[$this->_contact_id] = $this->_contact_id;
- list($currentContactDetails) = CRM_Utils_Token::getTokenDetails($contactIds, NULL,
- FALSE, FALSE, NULL, [],
- 'CRM_Event_BAO_Participant'
- );
- foreach ($currentContactDetails as $contactId => $contactValues) {
- $contactDetails[$this->_contact_id] = $contactValues;
- }
+
//send a 'cancelled' email to user, and cc the event's cc_confirm email
- $mail = CRM_Event_BAO_Participant::sendTransitionParticipantMail($this->_participant_id,
+ CRM_Event_BAO_Participant::sendTransitionParticipantMail($this->_participant_id,
$participantDetails[$this->_participant_id],
$eventDetails[$this->_event_id],
- $contactDetails[$this->_contact_id],
- $domainValues,
- "Cancelled",
- ""
+ NULL,
+ 'Cancelled'
);
$statusMsg = ts('Event registration information for %1 has been updated.', [1 => $this->_contact_name]);
$statusMsg .= ' ' . ts('A cancellation email has been sent to %1.', [1 => $this->_contact_email]);