public abstract class TemplateEmail extends java.lang.Object implements Email
| Constructor and Description |
|---|
TemplateEmail() |
| Modifier and Type | Method and Description |
|---|---|
protected static java.lang.String |
loadHtmlTemplate(java.lang.String templatePath)
Load a Thymeleaf HTML template from the application's resource folder and return it's content as a string.
|
protected static javax.activation.DataSource |
loadImageDataSource(java.lang.String resourcePath,
java.lang.String extension,
java.lang.String mimeType)
Load an image from the application's resources folder and open it as a data source.
|
protected static java.lang.String |
populateHtmlTemplate(java.lang.String template,
java.util.Map<java.lang.String,java.lang.Object> varMap)
Populate a Thymeleaf HTML template with the values provided in the context.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHtmlContent, getImages, getSubjectprotected static java.lang.String populateHtmlTemplate(java.lang.String template,
java.util.Map<java.lang.String,java.lang.Object> varMap)
template - the HTML template to populate with valuesvarMap - a map of template variable names and their corresponding valuesStringprotected static javax.activation.DataSource loadImageDataSource(java.lang.String resourcePath,
java.lang.String extension,
java.lang.String mimeType)
resourcePath - the relative path to the image resourceextension - the file extensionmimeType - the MIME type of the fileDataSource object, or null if loading the image failedprotected static java.lang.String loadHtmlTemplate(java.lang.String templatePath)
throws java.io.IOException
templatePath - the relative path to the HTML templateStringjava.io.IOException - if the file has an extension other than '.html'java.io.FileNotFoundException - if the file does not existCopyright © 2021. All rights reserved.