/**
* Populate the custom field and other remaining entity token data.
*
- * @param TokenRow $e
+ * @param TokenRow $row
* The record for which we want token values.
* @param string $entity
* The entity for which we want the token values
* @param array $tokens
- * The array of tokens whose data need to be fetched
+ * The array of tokens whose data need to be fetched
*/
public function evaluateExtraToken(TokenRow $row, $entity, $tokens) {
if (empty($tokens)) {
$contactTokens = \CRM_Utils_Array::value('contact', $messageTokens);
if (!empty($contactTokens)) {
try {
- $result = civicrm_api3('Contact', 'getsingle', array(
+ $result = civicrm_api3('Contact', 'getsingle', array(
'id' => $contactId,
'return' => $contactTokens,
- ));
- $contact = array_merge($contact, $result);
- }
- catch (CiviCRM_API3_Exception $e) {
- //do nothing
- }
+ ));
+ $contact = array_merge($contact, $result);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ //do nothing
+ }
}
}
else {
$e->string = \CRM_Utils_Token::replaceDomainTokens($e->string, \CRM_Core_BAO_Domain::getDomain(), $isHtml, $e->message['tokens'], $useSmarty);
if (!empty($e->context['contact'])) {
+ \CRM_Utils_Token::replaceGreetingTokens($e->string, $e->context['contact'], $e->context['contact']['contact_id'], NULL, FALSE);
+
$e->string = \CRM_Utils_Token::replaceContactTokens($e->string, $e->context['contact'], $isHtml, $e->message['tokens'], FALSE, $useSmarty);
// FIXME: This may depend on $contact being merged with hook values.
$e->string = \CRM_Utils_Token::replaceHookTokens($e->string, $e->context['contact'], $e->context['hookTokenCategories'], $isHtml, $useSmarty);
-
- \CRM_Utils_Token::replaceGreetingTokens($e->string, NULL, $e->context['contact']['contact_id'], NULL, $useSmarty);
}
if ($useSmarty) {