I have created a file “_emailTemplate” in “grails-app/views/teamplates” directory.Its a html template file, The content of the file is below,
<html>
<strong>Client: </strong>${client}<br/>
<strong>Training: </strong>${training}<br/>
<strong>Dates: </strong>${dates}<br/>
</html>
I want to load this file and replace the placeholders with the specific values like
${client} with the value of client variable etc.
How to do this.
You can render this template to a string. In any controller you can use this code:
gis a injected RenderTagLib instance. If you want to use it inside a service you must create an instance for yourself like this: