* @return array|null
* @throws \CiviCRM_API3_Exception
*/
- public static function sendMail($contactID, &$values, $participantId, $isTest = FALSE, $returnMessageText = FALSE) {
+ public static function sendMail($contactID, $values, $participantId, $isTest = FALSE, $returnMessageText = FALSE) {
$template = CRM_Core_Smarty::singleton();
$gIds = [
//send mail to primary as well as additional participants.
$this->assign('contactID', $contactId);
- $this->assign('participantID', $participantID);
CRM_Event_BAO_Event::sendMail($contactId, $this->_values, $participantID, $isTest);
}
}
*/
public function testSubmit() {
$event = $this->eventCreate();
+ $mut = new CiviMailUtils($this, TRUE);
CRM_Event_Form_Registration_Confirm::testSubmit([
'id' => $event['id'],
'contributeMode' => 'direct',
],
],
]);
- $this->callAPISuccessGetSingle('Participant', []);
+ $participant = $this->callAPISuccessGetSingle('Participant', []);
+ $mut->checkMailLog([
+ 'Dear Logged In, Thank you for your participation. This letter is a confirmation that your registration has been received and your status has been updated to Registered.',
+ ]);
+ $mut->stop();
+ $mut->clearMessages();
+ $tplVars = CRM_Core_Smarty::singleton()->get_template_vars();
+ $this->assertEquals($participant['id'], $tplVars['participantID']);
+
}
/**
'is_monetary' => 0,
'is_active' => 1,
'is_show_location' => 0,
+ 'is_email_confirm' => 1,
), $params);
return $this->callAPISuccess('Event', 'create', $params);