We have a bunch of NVelocity templates in embedded resources that we use for emails. We want to move these templates to the DB so they can be configured easily by users.
It seems though that NVelocity (Castle port) doesn't support strings as templates. Does anyone know how to do it.
To be clear this is what I want to do (syntax may be inaccurate, I'm going by memory) ...
string templateString = "Hello $!user";
Template template = new Template(templateString);
string results = template.Merge(....);
After much research on my own the Castle port of NVelocity seems like it would be a huge PITA to get the Template from an in memory string.
I've since given up on NVelocity and started use StringTemplate. Particularly this implementation: http://websitelogic.net/articles/MVC/stringtemplate-viewengine-asp-net-mvc/
This works for me: