Details
-
Type: New Feature
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: 4.4.4
-
Fix Version/s: Unscheduled
-
Component/s: Core CiviCRM
-
Labels:None
-
Versioning Impact:Patch (backwards-compatible bug fixes)
Description
feature request:
It's not uncommon for organizations to make layout adjustments to the various message templates. But doing so through the interface has several disadvantages:
- many of the templates are quite long and the UI doesn't lend itself toward easily modifying them
- many developers prefer to keep changes like this maintained in a VCS – which isn't as easily done when the template changes are all stored in the DB
- it's very difficult to implement any advanced conditionals. for example, an org might want to use a completely different template for pay later contributions vs. online contributions. while you can build conditional elements into the template, it gets cumbersome if the conditional elements are extensive in scope.
It would be great to have a hook that can be implemented to handle this. It likely could be implemented directly in CRM_Core_BAO_MessageTemplate::sendTemplate() – and be passed the params array by reference.
In addition to providing the ability to modify the params, it would be useful to provide a mechanism via the hook to easily allow a developer to reference a file to be used as the template, instead of the DB-stored template.