use of com.salesmanager.core.business.modules.email.EmailConfig in project shopizer by shopizer-ecommerce.
the class EmailServiceImpl method sendHtmlEmail.
@Override
public void sendHtmlEmail(MerchantStore store, Email email) throws ServiceException, Exception {
EmailConfig emailConfig = getEmailConfiguration(store);
sender.setEmailConfig(emailConfig);
sender.send(email);
}
use of com.salesmanager.core.business.modules.email.EmailConfig in project shopizer by shopizer-ecommerce.
the class EmailServiceImpl method getEmailConfiguration.
@Override
public EmailConfig getEmailConfiguration(MerchantStore store) throws ServiceException {
MerchantConfiguration configuration = merchantConfigurationService.getMerchantConfiguration(Constants.EMAIL_CONFIG, store);
EmailConfig emailConfig = null;
if (configuration != null) {
String value = configuration.getValue();
ObjectMapper mapper = new ObjectMapper();
try {
emailConfig = mapper.readValue(value, EmailConfig.class);
} catch (Exception e) {
throw new ServiceException("Cannot parse json string " + value);
}
}
return emailConfig;
}
Aggregations