public Mail templateMessage ( String template , Map < String , Object > content ) throws MangooTemplateEngineException { Objects . requireNonNull ( template , Required . TEMPLATE . toString ( ) ) ; Objects . requireNonNull ( content , Required . CONTENT . toString ( ) ) ; if ( template . charAt ( 0 ) == ' ' || template . startsWith ( "\\" ) ) { template = template . substring ( 1 , template . length ( ) ) ; } this . email . htmlMessage ( Application . getInstance ( TemplateEngine . class ) . renderTemplate ( new TemplateContext ( content ) . withTemplatePath ( template ) ) , Default . ENCODING . toString ( ) ) ; return this ; }
Sets a template to be rendered for the email . Using a template will make it a HTML Email by default .