Search in sources :

Example 1 with EmailConfig

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);
}
Also used : EmailConfig(com.salesmanager.core.business.modules.email.EmailConfig)

Example 2 with EmailConfig

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;
}
Also used : ServiceException(com.salesmanager.core.business.exception.ServiceException) EmailConfig(com.salesmanager.core.business.modules.email.EmailConfig) MerchantConfiguration(com.salesmanager.core.model.system.MerchantConfiguration) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) ServiceException(com.salesmanager.core.business.exception.ServiceException)

Aggregations

EmailConfig (com.salesmanager.core.business.modules.email.EmailConfig)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ServiceException (com.salesmanager.core.business.exception.ServiceException)1 MerchantConfiguration (com.salesmanager.core.model.system.MerchantConfiguration)1