protected String merge ( String template , Map values ) { StringWriter stringWriter = new StringWriter ( ) ; Configuration . getTemplateManager ( ) . merge ( values , template , stringWriter ) ; return stringWriter . toString ( ) ; }
Will merge a template and return resulting string . This method is used for just merging some text with dynamic values . Once you have the result you can send it by email external web service save it to a database etc .