Class ThymeleafMessageBuilder

java.lang.Object
com.broadleafcommerce.notification.service.ThymeleafMessageBuilder
All Implemented Interfaces:
MessageBuilder

public class ThymeleafMessageBuilder extends Object implements MessageBuilder
Builds a message using the data from the notification and the associated template
  • Constructor Details

  • Method Details

    • buildMessage

      public String buildMessage(Notification notification, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specified by:
      buildMessage in interface MessageBuilder
    • addAdditionalPropertiesToThymeleafContext

      protected void addAdditionalPropertiesToThymeleafContext(org.thymeleaf.context.Context thymeleafContext, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Responsible for adding any additional properties to the Thymeleaf context that a template may need.
      Parameters:
      thymeleafContext - the Thymeleaf Context on which to add additional properties
      contextInfo - context information surrounding multitenant state
    • getMessageVariablesFromProperties

      @Nullable protected NotificationServiceProperties.MessageProperties.MessageVariables getMessageVariablesFromProperties(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Finds the supporting message variables that should be used for the current contextInfo. If the current context is an application context and properties have been specifically defined for it, they are returned. If not, then there will be a check for properties specific for the current tenant. If neither check produces results, then null will be returned.
      Parameters:
      contextInfo - context information surrounding multitenant state
      Returns:
      the supporting message properties that should be used for the current context, or null if none are found
      See Also:
    • buildFullLogoUrl

      Responsible for building the fully qualified logo URL from properties.
      Parameters:
      assetProperties - properties from which to build the logo URL
      Returns:
      the fully qualified URL to the logo