Idea Summary
Template directives are a great tool for developers - however they can only be used in the APEX Builder environment.
It would be great if there was an API to process template directives in arbitrary “user supplied text” (think: CLOBs).
Motivation / Use Case
The current solution (templates as a developer tool) seems more aimed towards in-house development. But if developers are not in the same organisation as the application users the current solution is not sufficient: it is not acceptable to give users access to the development environment, it would be not practical to have developers make all (often iterative) changes. Also different user groups might need to have their own templates.
With this API it would be possible that users (think: “customers” as opposed to “in-house users”) could maintain their own templates within the application and apply them to their data. The resulting text could for example be used in communication like e-mail (see above why e-mail templates are not always the solution.)
Preferred Solution (Optional)
One possibility would be to extend APEX_STRING_UTIL, but having a separate package would also be ok. I would prefer to supply all inputs in parameters (=not to depend on database tables).