Class NotificationAccountInviteMessageListener
java.lang.Object
com.broadleafcommerce.notification.service.messaging.AbstractEmailNotificationMessageListener
com.broadleafcommerce.notification.service.messaging.NotificationAccountInviteMessageListener
public class NotificationAccountInviteMessageListener
extends AbstractEmailNotificationMessageListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class com.broadleafcommerce.notification.service.messaging.AbstractEmailNotificationMessageListener
EMAIL_DELIVERY, messages, notificationService, tenantProvider, typeFactory, userResolver
-
Constructor Summary
ConstructorsConstructorDescriptionNotificationAccountInviteMessageListener
(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, NotificationService<Notification> notificationService, org.springframework.context.MessageSource messages, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, AccountNotificationProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.data.tracking.core.context.ContextInfo
buildNotificationContext
(com.jayway.jsonpath.DocumentContext jsonContext) Build theContextInfo
for the current messagebuildRecipientsList
(com.jayway.jsonpath.DocumentContext jsonContext) Hook point to add additional logic to determine the list of recipients of the account invite notification.protected String
determineBaseUrl
(String identifierType, String identifierValue) protected void
protected String
getAccountInviteEmail
(com.jayway.jsonpath.DocumentContext jsonContext) protected String
getAccountInvitePhone
(com.jayway.jsonpath.DocumentContext jsonContext) protected String
getAccountName
(com.jayway.jsonpath.DocumentContext jsonContext) protected String
getAccountPageUrl
(String identifierType, String identifierValue, com.jayway.jsonpath.DocumentContext jsonContext) getAdditionalArgs
(com.jayway.jsonpath.DocumentContext jsonContext) protected String
Get the class name to identify this listener for handling message idempotency.protected String
getIdentifierType
(com.jayway.jsonpath.DocumentContext context) protected String
getIdentifierValue
(com.jayway.jsonpath.DocumentContext context) protected Locale
getLocale
(com.jayway.jsonpath.DocumentContext jsonContext) protected String
getMessageType
(com.jayway.jsonpath.DocumentContext jsonContext) Determine which message type should be sent.protected String
getNotificationSubject
(com.jayway.jsonpath.DocumentContext jsonContext) Determine the subject to use for the email notification.protected AccountNotificationProperties
getRecipients
(com.jayway.jsonpath.DocumentContext jsonContext) Determine the recipients to use for the email notification.protected String
getRegistrationUrl
(String identifierType, String identifierValue, com.jayway.jsonpath.DocumentContext jsonContext) void
handleMessage
(org.springframework.messaging.Message<String> message) protected void
modifyNotification
(Notification notification, com.jayway.jsonpath.DocumentContext jsonContext, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Extension point to allow modifying the notification or context before sending to the notification serviceprotected boolean
validateShouldSendNotification
(com.jayway.jsonpath.DocumentContext jsonContext) Validate that the message state is valid to send the email.Methods inherited from class com.broadleafcommerce.notification.service.messaging.AbstractEmailNotificationMessageListener
buildNotification, buildNotification, getDocumentContext, getIdempotentConsumptionService, getMessages, getNotificationService, getObjectMapper, getPayload, getTenantProvider, getTypeFactory, getUserResolver, handleMessageInternal, modifyNotification, processMessage, resolveApplicationById, setTenantProvider, setUserResolver
-
Field Details
-
ACCOUNT_INVITE_EMAIL
- See Also:
-
ACCOUNT_INVITE_PHONE
- See Also:
-
ACCOUNT_INVITE_ID
- See Also:
-
ACCOUNT_NAME
- See Also:
-
ADDL_ARGS
- See Also:
-
APPLICATION_ID_PATH
- See Also:
-
TENANT_ID_PATH
- See Also:
-
LOCALE
- See Also:
-
IDENTIFIER_TYPE
- See Also:
-
IDENTIFIER_VALUE
- See Also:
-
MESSAGE_TYPE
- See Also:
-
ACCOUNT_INVITE_SUBJECT
- See Also:
-
IDENTIFIER_TYPE_PARAM
- See Also:
-
IDENTIFIER_VAL_PARAM
- See Also:
-
-
Constructor Details
-
NotificationAccountInviteMessageListener
public NotificationAccountInviteMessageListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, NotificationService<Notification> notificationService, org.springframework.context.MessageSource messages, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, AccountNotificationProperties properties)
-
-
Method Details
-
handleMessage
@StreamListener("accountInvitationInputNotification") public void handleMessage(org.springframework.messaging.Message<String> message) -
getAdditionalArgs
-
getAccountInviteEmail
-
getAccountInvitePhone
-
getAccountName
-
getLocale
-
getClassName
Description copied from class:AbstractEmailNotificationMessageListener
Get the class name to identify this listener for handling message idempotency.- Specified by:
getClassName
in classAbstractEmailNotificationMessageListener
- Returns:
- the listener's class name
-
modifyNotification
protected void modifyNotification(Notification notification, com.jayway.jsonpath.DocumentContext jsonContext, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from class:AbstractEmailNotificationMessageListener
Extension point to allow modifying the notification or context before sending to the notification service- Overrides:
modifyNotification
in classAbstractEmailNotificationMessageListener
- Parameters:
notification
- the Notification for the current messagejsonContext
- the message payloadcontext
- The context of the request
-
determineSupportedResolutionTypes
protected void determineSupportedResolutionTypes() -
getAccountPageUrl
-
getRegistrationUrl
-
determineBaseUrl
-
validateShouldSendNotification
protected boolean validateShouldSendNotification(com.jayway.jsonpath.DocumentContext jsonContext) Description copied from class:AbstractEmailNotificationMessageListener
Validate that the message state is valid to send the email.- Specified by:
validateShouldSendNotification
in classAbstractEmailNotificationMessageListener
- Parameters:
jsonContext
- the message payload- Returns:
- whether the email should be sent
-
getMessageType
Description copied from class:AbstractEmailNotificationMessageListener
Determine which message type should be sent.- Specified by:
getMessageType
in classAbstractEmailNotificationMessageListener
- Parameters:
jsonContext
- the message payload- Returns:
- the message type to send
-
getNotificationSubject
Description copied from class:AbstractEmailNotificationMessageListener
Determine the subject to use for the email notification.- Specified by:
getNotificationSubject
in classAbstractEmailNotificationMessageListener
- Parameters:
jsonContext
- the message payload- Returns:
- the subject to use for the email notification
-
getRecipients
Description copied from class:AbstractEmailNotificationMessageListener
Determine the recipients to use for the email notification.- Specified by:
getRecipients
in classAbstractEmailNotificationMessageListener
- Parameters:
jsonContext
- the message payload- Returns:
- the recipients to use for the email notification
-
buildRecipientsList
Hook point to add additional logic to determine the list of recipients of the account invite notification.- Parameters:
jsonContext
- The message payload- Returns:
- the list of recipients
-
buildNotificationContext
protected com.broadleafcommerce.data.tracking.core.context.ContextInfo buildNotificationContext(com.jayway.jsonpath.DocumentContext jsonContext) Description copied from class:AbstractEmailNotificationMessageListener
Build theContextInfo
for the current message- Specified by:
buildNotificationContext
in classAbstractEmailNotificationMessageListener
- Parameters:
jsonContext
- the payload of the message- Returns:
- the NotificationContext for the current message
-
getIdentifierType
-
getIdentifierValue
-
getProperties
-