code: public String render(String templateName, EmailModel emailModel, Map<String, Object> model, Locale locale) {
  
  		if (logger.isDebugEnabled()) {
  			logger.debug("Rendering template [{}] for recipient [{}]", templateName, emailModel.getTo());
  		}
  
  		final IEngineConfiguration engineConfiguration = templateEngineFactory.getTemplateEngine().getConfiguration();
  		final ExpressionContext context = new ExpressionContext(engineConfiguration, locale);
  
          context.setVariable(ThymeleafEvaluationContext.THYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME,
                  new ThymeleafEvaluationContext(applicationContext, null));
  
  		context.setVariables(model);
  		context.setVariable(THYMELEAF_EMAIL_MODEL_NAME, emailModel);
  		return templateEngineFactory.getTemplateEngine().process(templateName, context);
  	}
docs: renders a template and returns its output
  
  @param templateName the templateName to be resolved by Thymeleafs templateResolver
  @param emailModel the emailModel
  @param model additional model
  @param locale the locale
  
  @return rendered output