META Token improvements (TokenProcessor)
For quite a long time there has been a newer "TokenProcessor" in CiviCRM core, but it was only implemented for scheduled reminders initially. It can be used with this branch of the emailapi extension: https://lab.civicrm.org/mattwire/emailapi/tree/newtokenprocessor
Basically it is a more flexible token processor. @ayduns did a big chunk of work to implement activity tokens:
- https://github.com/civicrm/civicrm-core/pull/12012 - Add functionality to create PDF/Word docs from Activity searches
- https://github.com/civicrm/civicrm-core/pull/14662 - Add PDF letter functionality for Activities using new token processor
This part allows for more advanced "keyed" tokens so you can (for example) select a specific contact when there are multiple on an activity and supports activity PDFs:
It would be good to extend to all token entities and we have a trait to help with that:
-
https://github.com/civicrm/civicrm-core/pull/16468 - REF Refactor ActivityTokens to use a trait that can be shared with other entitiesmerged Draft PR for adding tokenprocessor support to contributions: - https://github.com/civicrm/civicrm-core/pull/16612 - WIP Support contribution tokens using TokenProcessor Support for Case tokens using tokenProcessor:
- https://github.com/mattwire/civicrm-core/tree/casetokenprocessor
There is some work that needs to be done to improve consistency and make development of the TokenProcessor easier. Reviewers are needed for:
- https://github.com/civicrm/civicrm-core/pull/16983 - Standardise what we pass to tokenProcessor so we don't have to add specific handling in each class for actionSchedule
- https://github.com/civicrm/civicrm-core/pull/18612 - Simplify TokenProcessor code