Class EmailTemplateNotificationServiceImpl
java.lang.Object
com.broadleafcommerce.advancedcms.notification.service.EmailTemplateNotificationServiceImpl
- All Implemented Interfaces:
org.broadleafcommerce.common.notification.service.NotificationService
public class EmailTemplateNotificationServiceImpl
extends Object
implements org.broadleafcommerce.common.notification.service.NotificationService
- Author:
- Nick Crum ncrum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentTargeterServiceprotected static final Stringprotected List<org.broadleafcommerce.common.email.service.info.EmailInfo>protected EmailTemplateServiceprotected org.broadleafcommerce.common.email.service.EmailTrackingManagerprotected org.springframework.core.env.Environmentprotected org.broadleafcommerce.common.expression.BroadleafExpressionParserprotected final org.apache.commons.logging.Logprotected org.broadleafcommerce.common.email.service.message.MessageCreator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandle(Class<? extends org.broadleafcommerce.common.notification.service.type.Notification> clazz) protected org.broadleafcommerce.common.email.service.info.EmailInfogetEmailInfo(org.broadleafcommerce.common.notification.service.type.NotificationEventType type) This helper method makes use of any defined EmailInfo with the given type as a foundation for the EmailInfo.protected StringgetEmailTemplateProperty(org.broadleafcommerce.common.notification.service.type.NotificationEventType notificationEventType, String propertyName) protected StringgetFromAddress(org.broadleafcommerce.common.notification.service.type.EmailNotification notification, EmailTemplate emailTemplate, org.broadleafcommerce.common.email.service.info.EmailInfo emailInfo) protected StringgetSubject(org.broadleafcommerce.common.notification.service.type.EmailNotification notification, EmailTemplate emailTemplate, org.broadleafcommerce.common.email.service.info.EmailInfo emailInfo) protected StringgetToAddress(org.broadleafcommerce.common.notification.service.type.EmailNotification notification, EmailTemplate emailTemplate) protected voidsendEmailNotification(org.broadleafcommerce.common.notification.service.type.EmailNotification notification, EmailTemplate emailTemplate) voidsendNotification(org.broadleafcommerce.common.notification.service.type.Notification notification)
-
Field Details
-
EMAIL_TEMPLATE_PROPERTY_PREFIX
- See Also:
-
LOG
protected final org.apache.commons.logging.Log LOG -
environment
@Autowired protected org.springframework.core.env.Environment environment -
emailInfos
@Autowired(required=false) protected List<org.broadleafcommerce.common.email.service.info.EmailInfo> emailInfos -
emailTemplateService
-
contentTargeterService
-
messageCreator
@Qualifier("blMessageCreator") @Lazy protected org.broadleafcommerce.common.email.service.message.MessageCreator messageCreator -
expressionParser
@Qualifier("blExpressionParser") protected org.broadleafcommerce.common.expression.BroadleafExpressionParser expressionParser -
emailTrackingManager
protected org.broadleafcommerce.common.email.service.EmailTrackingManager emailTrackingManager
-
-
Constructor Details
-
EmailTemplateNotificationServiceImpl
public EmailTemplateNotificationServiceImpl()
-
-
Method Details
-
canHandle
public boolean canHandle(Class<? extends org.broadleafcommerce.common.notification.service.type.Notification> clazz) - Specified by:
canHandlein interfaceorg.broadleafcommerce.common.notification.service.NotificationService
-
sendNotification
public void sendNotification(org.broadleafcommerce.common.notification.service.type.Notification notification) - Specified by:
sendNotificationin interfaceorg.broadleafcommerce.common.notification.service.NotificationService
-
sendEmailNotification
protected void sendEmailNotification(org.broadleafcommerce.common.notification.service.type.EmailNotification notification, EmailTemplate emailTemplate) throws org.springframework.mail.MailException, org.broadleafcommerce.common.exception.ServiceException - Throws:
org.springframework.mail.MailExceptionorg.broadleafcommerce.common.exception.ServiceException
-
getEmailInfo
protected org.broadleafcommerce.common.email.service.info.EmailInfo getEmailInfo(org.broadleafcommerce.common.notification.service.type.NotificationEventType type) This helper method makes use of any defined EmailInfo with the given type as a foundation for the EmailInfo.- Parameters:
type- the notification type- Returns:
- the new EmailInfo
-
getToAddress
protected String getToAddress(org.broadleafcommerce.common.notification.service.type.EmailNotification notification, EmailTemplate emailTemplate) -
getFromAddress
protected String getFromAddress(org.broadleafcommerce.common.notification.service.type.EmailNotification notification, EmailTemplate emailTemplate, org.broadleafcommerce.common.email.service.info.EmailInfo emailInfo) -
getSubject
protected String getSubject(org.broadleafcommerce.common.notification.service.type.EmailNotification notification, EmailTemplate emailTemplate, org.broadleafcommerce.common.email.service.info.EmailInfo emailInfo) -
getEmailTemplateProperty
-