Details
-
Type: Improvement
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: 4.7, 4.7.15
-
Fix Version/s: None
-
Component/s: Core CiviCRM
-
Labels:None
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:User and Admin Doc
-
Funding Source:Needs Funding
-
Verified?:No
Description
(I thought there'd be an issue for this already but couldn't find one. Is this a duplicate?)
For hook-based custom tokens for non-contact entities, the hook_civiccrm_tokenValues implementation is given the relevant contact ID, but not an ID for the relevant non-contact entity, e.g., the relevant contribution for a thank-you letter.
As a result, the custom token can return aggregate or other generalized information about the contact's entities (e.g., last contribution, total contributions in a fixed date range, etc.) but can't return anything based on the specific entity (e.g. contribution).
This could potentially be resolved by finding a way to provide the relevant entity ID to hook_civiccrm_tokenValues.