public class TemplateMessageUtil extends Object
StandardMessageCodes
createMessage(String, Map)
or createMessage(String, String, Map)
to render a message based on your template.Modifier and Type | Field and Description |
---|---|
static String |
FALLBACK_LANGUAGE
The default language if no language is set
|
static String |
STANDARD_MESSAGES_TEMPLATE_KEY
The template definition key used for standard messages.
|
static String |
VARIANT_KEY_LANGUAGE |
static String |
VARIANT_KEY_MESSAGE_CODE |
Modifier and Type | Method and Description |
---|---|
static String |
createMessage(String messageCode,
Map<String,Object> payload)
Creates a standard message based on the provided message code and payload.
|
static String |
createMessage(String messageCode,
String language,
Map<String,Object> payload)
Creates a standard message based on the provided message code and payload.
|
static String |
createMessage(String messageTemplateKey,
String messageCode,
String language,
Map<String,Object> payload)
Creates a message based on the provided template key, message code and payload.
|
public static final String STANDARD_MESSAGES_TEMPLATE_KEY
public static final String VARIANT_KEY_MESSAGE_CODE
public static final String VARIANT_KEY_LANGUAGE
public static final String FALLBACK_LANGUAGE
public static String createMessage(String messageCode, Map<String,Object> payload)
TemplateVariationModel
. This one uses english as the default language.messageCode
- the message code to choose the template variation forpayload
- the optional payload containing the necessary parameters (if any needed by the template)public static String createMessage(String messageCode, String language, Map<String,Object> payload)
TemplateVariationModel
.messageCode
- the message code to choose the template variation forlanguage
- the language (e.g. "en") for which the message should be renderedpayload
- the optional payload containing the necessary parameters (if any needed by the template)public static String createMessage(String messageTemplateKey, String messageCode, String language, Map<String,Object> payload)
TemplateVariationModel
.messageTemplateKey
- the template key of the message template to be usedmessageCode
- the message code to choose the template variation forlanguage
- the language (e.g. "en") for which the message should be renderedpayload
- the optional payload containing the necessary parameters (if any needed by the template)Copyright © 2019. All rights reserved.