use of org.stringtemplate.v4.STGroupDir in project uPortal by Jasig.
the class EmailPasswordResetNotificationImpl method formatBody.
/**
* Get the body content of the email.
*
* @param resetUrl the password reset URL
* @param account the user account that has had its password reset
* @param locale the locale of the user who reset the password
* @return The message body as a string.
*/
private String formatBody(URL resetUrl, ILocalAccountPerson account, Locale locale) {
final STGroup group = new STGroupDir(templateDir, '$', '$');
final ST template = group.getInstanceOf(templateName);
String name = findDisplayNameFromLocalAccountPerson(account);
template.add("displayName", name);
template.add("url", resetUrl.toString());
return template.render();
}
use of org.stringtemplate.v4.STGroupDir in project bndtools by bndtools.
the class STTests method test.
@Test
public void test() {
STGroupDir group = new STGroupDir("testdata/stuff", '$', '$');
ST st = group.getInstanceOf("foo");
st.add("name", "Neil");
System.out.println(st.render());
}
Aggregations