Sometimes, you need to use the handy schedule reminders to send out emails containing additional info, currently not made available in the core code. The idea is to make this open and extensible. In addition, this aims at enabling reminders for other types of entities in CiviCRM.
This change introduces a new hook (mod Utils/Hook.php) and refactors the ActionSchedule to allow different types of additional tokens to be added before the email message is composed :
- tokens you can add directly, regardless of the context of the reminder
- tokens depending on data you prefer to include in the original data query
- tokens you may want to add based on data returned by the current query.
Example of a hook which does this:
— Open issues —
Currently, you can only work on existing entities. I am working on a fix to ActionSchedule:getSelection* to include that into the hook as well, so the UI automatically picks up the additional action_mappings (to be installed with the module/extension) and drive the UI accordingly. Nonetheless, this extension is useful without the changes to this method.