AlertUtil's message is currently added to the freemarker context only in FreemarkerUtil (contrary to other default values which are added by FreemarkerHelper. Not sure how to handle this, for two reasons:
- "message" seems a too generic key name (ie it might "accidentally" be used by the template for another purpose)
- we're having more and more "default values" added to the freemarker context, and maybe they just all belong to the magnolia context, which is already exposed to the template as "ctx".
The feature where we passed a template stream/reader to FreeMarker templates inline also needs a review/cleanup. It is used by the mail module and we could probably be using a TemplateLoader to achieve this. In fact, Freemarker provides an abstract URLTemplateLoader, and it would be fairly trivial to implement it so that it fetches a page from a given Magnolia instance pretty much the same way the mail module does it at the moment.