Package org.ametys.core.ui.mail
Class StandardMailBodyHelper.MailBodyBuilder
java.lang.Object
org.ametys.core.ui.mail.StandardMailBodyHelper.MailBodyBuilder
- Enclosing class:
- StandardMailBodyHelper
Implements the builder pattern for creating and sending emails.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final recordRecord for an user input from a non-authenticated userstatic final recordRecord for an user input
- 
Method SummaryModifier and TypeMethodDescriptionaddMessage(String message) Add a new messageaddMessage(I18nizableText message) Add a new messageaddUnauthenticatedUserInput(StandardMailBodyHelper.MailBodyBuilder.UnauthenticatedUserInput unauthenticatedUserInput) Add an user input from a non-authenticated userAdd an user inputbuild()Build the body of the email as HTMLtoJson()Get the JSON representation of the email ingredientswithDetails(I18nizableText detailsTitle, String detailsText, boolean technical) Set details or additional information to display in the mailwithDetails(I18nizableText detailsTitle, I18nizableText detailsText, boolean technical) Set details or additional information to display in the mailwithFooterBottomText(String footerText) Set the text to display at footer bottom such as "Autogenerated email.withFooterBottomText(I18nizableText footerText) Set the text to display at footer bottom such as "Autogenerated email.withFooterLink(String linkUrl, I18nizableText linkText) Add a link to be displayed on footerwithFooterLink(String linkUrl, I18nizableText linkText, String imgPluginName, String imgPath) Add a link to be displayed on footerwithLanguage(String lang) Set the languagewithLink(String linkUrl, I18nizableText linkText) Add a main link to be displayed as a buttonwithMessage(String message) Set the main messagewithMessage(I18nizableText message) Set the main messageSet the titlewithTitle(I18nizableText title) Set the titlewithUnauthenticatedUserInput(StandardMailBodyHelper.MailBodyBuilder.UnauthenticatedUserInput unauthenticatedUserInput) Add an user input from a non-authenticated userwithUnauthenticatedUserInput(StandardMailBodyHelper.MailBodyBuilder.UnauthenticatedUserInput unauthenticatedUserInput, I18nizableText userInputHeader) Add an user input from a non-authenticated userSet the user actionwithUserInput(StandardMailBodyHelper.MailBodyBuilder.UserInput userInput, I18nizableText userInputHeader) Set the user actionwithUserInputHeader(I18nizableText userInputHeader) Set the user action
- 
Method Details- 
withLanguageSet the language- Parameters:
- lang- the language
- Returns:
- this builder
 
- 
withTitleSet the title- Parameters:
- title- the title as- I18nizableText
- Returns:
- this builder
 
- 
withTitleSet the title- Parameters:
- title- the title as String
- Returns:
- this builder
 
- 
withMessageSet the main message- Parameters:
- message- the message as String or- I18nizableText
- Returns:
- this builder
 
- 
withMessageSet the main message- Parameters:
- message- the message as String or- I18nizableText
- Returns:
- this builder
 
- 
addMessageAdd a new message- Parameters:
- message- the message as- I18nizableText
- Returns:
- this builder
 
- 
addMessageAdd a new message- Parameters:
- message- the message as String
- Returns:
- this builder
 
- 
withLinkAdd a main link to be displayed as a button- Parameters:
- linkUrl- the link url
- linkText- the link text
- Returns:
- this builder
 
- 
withUserInputHeaderSet the user action- Parameters:
- userInputHeader- The header text for user input(s)
- Returns:
- this builder
 
- 
withUserInputpublic StandardMailBodyHelper.MailBodyBuilder withUserInput(StandardMailBodyHelper.MailBodyBuilder.UserInput userInput) Set the user action- Parameters:
- userInput- the user action such as a comment
- Returns:
- this builder
 
- 
withUserInputpublic StandardMailBodyHelper.MailBodyBuilder withUserInput(StandardMailBodyHelper.MailBodyBuilder.UserInput userInput, I18nizableText userInputHeader) Set the user action- Parameters:
- userInput- the user action such as a comment
- userInputHeader- The header text for user input
- Returns:
- this builder
 
- 
addUserInputpublic StandardMailBodyHelper.MailBodyBuilder addUserInput(StandardMailBodyHelper.MailBodyBuilder.UserInput userInput) Add an user input- Parameters:
- userInput- the user input such as a comment
- Returns:
- this builder
 
- 
withUnauthenticatedUserInputpublic StandardMailBodyHelper.MailBodyBuilder withUnauthenticatedUserInput(StandardMailBodyHelper.MailBodyBuilder.UnauthenticatedUserInput unauthenticatedUserInput, I18nizableText userInputHeader) Add an user input from a non-authenticated user- Parameters:
- unauthenticatedUserInput- the input such as a comment
- userInputHeader- The header text for user input as String or- I18nizableText
- Returns:
- this builder
 
- 
withUnauthenticatedUserInputpublic StandardMailBodyHelper.MailBodyBuilder withUnauthenticatedUserInput(StandardMailBodyHelper.MailBodyBuilder.UnauthenticatedUserInput unauthenticatedUserInput) Add an user input from a non-authenticated user- Parameters:
- unauthenticatedUserInput- the input such as a comment
- Returns:
- this builder
 
- 
addUnauthenticatedUserInputpublic StandardMailBodyHelper.MailBodyBuilder addUnauthenticatedUserInput(StandardMailBodyHelper.MailBodyBuilder.UnauthenticatedUserInput unauthenticatedUserInput) Add an user input from a non-authenticated user- Parameters:
- unauthenticatedUserInput- the input such as a comment
- Returns:
- this builder
 
- 
withDetailspublic StandardMailBodyHelper.MailBodyBuilder withDetails(I18nizableText detailsTitle, String detailsText, boolean technical) Set details or additional information to display in the mail- Parameters:
- detailsTitle- the details title
- detailsText- the details text
- technical- true if details are technical details (such as an error stack trace, script result, ...)
- Returns:
- this builder
 
- 
withDetailspublic StandardMailBodyHelper.MailBodyBuilder withDetails(I18nizableText detailsTitle, I18nizableText detailsText, boolean technical) Set details or additional information to display in the mail- Parameters:
- detailsTitle- the details title
- detailsText- the details text
- technical- true if details are technical details (such as an error stack trace, script result, ...)
- Returns:
- this builder
 
- 
buildBuild the body of the email as HTML- Returns:
- the HTML body
- Throws:
- IOException- if an error occurred when building the email
 
- 
toJsonGet the JSON representation of the email ingredients- Returns:
- the JSON ingredients
 
 
-