Commit 22e850a5 authored by jaapjansma's avatar jaapjansma

Merge branch 'hook-fix' into 'master'

fixes #5: Incorrect argument for tokenValues hook

Closes #5

See merge request !6
parents 5bce59b6 31352b3a
......@@ -161,7 +161,11 @@ function civicrm_api3_email_send($params) {
$toName = $contact['display_name'];
}
CRM_Utils_Hook::tokenValues($contact, $contact['contact_id'], NULL, $tokens);
// Change the contact array to the format the hook expects.
$contactHookArray[$contact['contact_id']] = $contact;
CRM_Utils_Hook::tokenValues($contactHookArray, array_keys($contactHookArray), NULL, $tokens);
// Now update the original array.
$contact = $contactHookArray[$contact['contact_id']];
// call token hook
$hookTokens = [];
CRM_Utils_Hook::tokens($hookTokens);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment