Class EmailPreview
java.lang.Object
io.meeds.portal.mail.util.EmailPreview
A sample of an email of the platform, with the saved branding,
for the preview of the branding page. The two
samples are the account emails that use the shared layout for real, with the
labels of the same bundle and the same structure as the email a user
receives, so that what the administrator sees is what is sent.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisTemplate(String template) static Stringrender(String template, EmailBrand brand, ResourceBundle bundle, String lang, String siteUrl) static Stringrender(String template, EmailBrand brand, ResourceBundle bundle, String lang, String siteUrl, EmailPreviewReader reader) Same asrender(String, EmailBrand, ResourceBundle, String, String)with the person who reads the preview, so that the greeting is the one the administrator would get; a blank value is replaced by a sample one
-
Field Details
-
INVITATION
-
PASSWORD_RESET
The email that lets a user choose a new password- See Also:
-
TEMPLATES
-
-
Method Details
-
isTemplate
-
render
public static String render(String template, EmailBrand brand, ResourceBundle bundle, String lang, String siteUrl) - Parameters:
template- one ofTEMPLATESbrand- the branding to show, the saved onebundle- the labels of the language of the previewlang- the language tag of the documentsiteUrl- the address of the site, which the sample link points to; anything that is not an http or https address is replaced by an example address- Returns:
- the html of the sample email
- Throws:
IllegalArgumentException- when the template is not known
-
render
public static String render(String template, EmailBrand brand, ResourceBundle bundle, String lang, String siteUrl, EmailPreviewReader reader) Same asrender(String, EmailBrand, ResourceBundle, String, String)with the person who reads the preview, so that the greeting is the one the administrator would get; a blank value is replaced by a sample one- Parameters:
reader- the reader of the preview, or null for sample names
-