}
$defaults = [
- 'contact_id' => $contact['id'],
+ 'contactId' => $contact['id'],
'toName' => $contact['display_name'],
'toEmail' => $contact['email'],
'text' => '',
* fullPath : complete pathname to the file
* mime_type: mime type of the attachment
* cleanName: the user friendly name of the attachmment
+ * contactId : contact id to send the email to (optional)
*
* @param array $params
* (by reference).
'autoSubmitted' => ['type' => 'bool', 'for' => 'messageTemplate'],
'Message-ID' => ['type' => 'string', 'for' => ['messageTemplate', 'singleEmail']],
'messageId' => ['type' => 'string', 'for' => ['messageTemplate', 'singleEmail']],
+ 'contactId' => ['type' => 'int|NULL', 'for' => ['messageTemplate' /* deprecated in favor of tokenContext[contactId] */, 'singleEmail']],
// ## Envelope: CiviMail/Flexmailer
'tokenContext' => ['type' => 'array', 'for' => 'messageTemplate'],
'tplParams' => ['type' => 'array', 'for' => 'messageTemplate'],
- 'contactId' => ['type' => 'int|NULL', 'for' => 'messageTemplate' /* deprecated in favor of tokenContext[contactId] */],
'workflow' => [
'regex' => '/^([a-zA-Z_]+)$/',
'type' => 'string',
parent::setUp();
$this->_individualId = $this->individualCreate(['first_name' => 'Anthony', 'last_name' => 'Collins']);
$this->_docTypes = CRM_Core_SelectValues::documentApplicationType();
+ $hooks = \CRM_Utils_Hook::singleton();
+ $hooks->setHook('civicrm_alterMailParams',
+ array($this, 'hook_alterMailParams'));
}
/**
return $this->callAPISuccess('Contribution', 'create', $contributionParams)['id'];
}
+ /**
+ * @see CRM_Utils_Hook::alterMailParams
+ */
+ public function hook_alterMailParams(&$params, $context = NULL) {
+ $this->assertTrue(isset($params['contactId']));
+ }
+
}