Class MessageComposer
- java.lang.Object
-
- io.github.astrapi69.message.mail.utils.MessageComposer
-
public class MessageComposer extends java.lang.Object
The Class MessageComposer.
-
-
Constructor Summary
Constructors Constructor Description MessageComposer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MessageContent
createMessageModel(java.util.Map<java.lang.String,java.lang.Object> contextModel, java.lang.String xmlMailTemplateName, java.util.Locale locale)
Creates the message model.static MessageContent
getEmailTemplate(java.lang.String name)
Gets the email template as a BaseMessage Model that contains the velocity templates.static java.lang.String
getXmlMailTemplateName(java.lang.String xmlMailTemplateName, java.util.Locale locale, boolean withCountry)
Gets the xml mail template name from the given String and Locale.
-
-
-
Method Detail
-
createMessageModel
public static MessageContent createMessageModel(java.util.Map<java.lang.String,java.lang.Object> contextModel, java.lang.String xmlMailTemplateName, java.util.Locale locale) throws java.io.IOException, org.apache.velocity.runtime.parser.ParseException, java.net.URISyntaxException
Creates the message model.- Parameters:
contextModel
- the velocity context modelxmlMailTemplateName
- the xml mail template namelocale
- the locale- Returns:
- the message model
- Throws:
java.io.IOException
- Signals that an I/O exception has occurred.org.apache.velocity.runtime.parser.ParseException
- the parse exceptionjava.net.URISyntaxException
- the URI syntax exception
-
getEmailTemplate
public static MessageContent getEmailTemplate(java.lang.String name) throws java.io.IOException
Gets the email template as a BaseMessage Model that contains the velocity templates.- Parameters:
name
- The resource name that represents an IMessageModel as an xml file.- Returns:
- the email template
- Throws:
java.io.IOException
- Signals that an I/O exception has occurred.
-
getXmlMailTemplateName
public static java.lang.String getXmlMailTemplateName(java.lang.String xmlMailTemplateName, java.util.Locale locale, boolean withCountry)
Gets the xml mail template name from the given String and Locale.- Parameters:
xmlMailTemplateName
- the xml mail template namelocale
- the localewithCountry
- the with country- Returns:
- the xml mail template name
-
-