class MailService {

	@SuppressWarnings("deprecation")
	public String processTemplate(String templateUrl, Map<String, Object> model) {
		try {
			if(templateUrl != null) {
				String mailBody = mailContentBuilderService.getRemoteMailContent(templateUrl);
				Configuration cfg = new Configuration();
				cfg.setObjectWrapper(new DefaultObjectWrapper());
				Template t = new Template(UUID.randomUUID().toString(), new StringReader(mailBody), cfg);
			    Writer out = new StringWriter();
				t.process(model, out);
				return out.toString();
			}
		} catch (Exception exception) {
			Log.error(exception.getMessage());
		}
		return null;
	}

	@Autowired public  MailService(JavaMailSender mailSender, MailContentBuilderService mailContentBuilderService);

}