use of org.broadleafcommerce.common.email.service.info.EmailInfo in project BroadleafCommerce by BroadleafCommerce.
the class AdminSpringBootTestConfiguration method blFulfillmentOrderTrackingEmailInfo.
@Bean
public EmailInfo blFulfillmentOrderTrackingEmailInfo() {
EmailInfo info = blEmailInfo();
info.setSubject("Your order with The Heat Clinic Has Shipped");
info.setEmailTemplate("fulfillmentOrderTracking-email");
return info;
}
use of org.broadleafcommerce.common.email.service.info.EmailInfo in project BroadleafCommerce by BroadleafCommerce.
the class EmailStatusHandler method handleStatus.
public void handleStatus(String serviceName, ServiceStatusType status) {
String message = serviceName + " is reporting a status of " + status.getType();
EmailInfo copy = emailInfo.clone();
copy.setMessageBody(message);
copy.setSubject(message);
emailService.sendBasicEmail(copy, emailTarget, null);
}
use of org.broadleafcommerce.common.email.service.info.EmailInfo in project BroadleafCommerce by BroadleafCommerce.
the class JMSEmailServiceProducerImpl method send.
public void send(final Map props) {
if (props instanceof Serializable) {
final Serializable sProps = (Serializable) props;
emailServiceTemplate.send(emailServiceDestination, new MessageCreator() {
public Message createMessage(Session session) throws JMSException {
ObjectMessage message = session.createObjectMessage(sProps);
EmailInfo info = (EmailInfo) props.get(EmailPropertyType.INFO.getType());
message.setJMSPriority(Integer.parseInt(info.getSendAsyncPriority()));
return message;
}
});
} else {
throw new IllegalArgumentException("The properties map must be Serializable");
}
}
use of org.broadleafcommerce.common.email.service.info.EmailInfo in project BroadleafCommerce by BroadleafCommerce.
the class EmailServiceImpl method sendBasicEmail.
public boolean sendBasicEmail(EmailInfo emailInfo, EmailTarget emailTarget, Map<String, Object> props) {
if (props == null) {
props = new HashMap<String, Object>();
}
if (emailInfo == null) {
emailInfo = new EmailInfo();
}
props.put(EmailPropertyType.INFO.getType(), emailInfo);
props.put(EmailPropertyType.USER.getType(), emailTarget);
if (Boolean.parseBoolean(emailInfo.getSendEmailReliableAsync())) {
if (emailServiceProducer == null) {
throw new EmailException("The property sendEmailReliableAsync on EmailInfo is true, but the EmailService does not have an instance of JMSEmailServiceProducer set.");
}
emailServiceProducer.send(props);
} else {
messageCreator.sendMessage(props);
}
return true;
}
use of org.broadleafcommerce.common.email.service.info.EmailInfo in project BroadleafCommerce by BroadleafCommerce.
the class EmailServiceImpl method sendTemplateEmail.
public boolean sendTemplateEmail(EmailTarget emailTarget, EmailInfo emailInfo, Map<String, Object> props) {
if (props == null) {
props = new HashMap<String, Object>();
}
if (emailInfo == null) {
emailInfo = new EmailInfo();
}
props.put(EmailPropertyType.INFO.getType(), emailInfo);
props.put(EmailPropertyType.USER.getType(), emailTarget);
Long emailId = emailTrackingManager.createTrackedEmail(emailTarget.getEmailAddress(), emailInfo.getEmailType(), null);
props.put("emailTrackingId", emailId);
return sendBasicEmail(emailInfo, emailTarget, props);
}
Aggregations