Search in sources :

Example 1 with EmailPropertyKeys

use of com.synopsys.integration.alert.service.email.enumeration.EmailPropertyKeys in project hub-alert by blackducksoftware.

the class JavamailPropertiesFactory method createJavaMailProperties.

@Deprecated(forRemoval = true)
public Properties createJavaMailProperties(FieldUtility fieldUtility) {
    if (fieldUtility == null) {
        throw new IllegalArgumentException("Could not find the global Email configuration");
    }
    Properties javaMailProperties = new Properties();
    for (EmailPropertyKeys emailPropertyKey : EmailPropertyKeys.values()) {
        String key = emailPropertyKey.getPropertyKey();
        String value = fieldUtility.getStringOrEmpty(key);
        if (StringUtils.isNotBlank(value)) {
            javaMailProperties.setProperty(key, value);
        }
    }
    return javaMailProperties;
}
Also used : EmailPropertyKeys(com.synopsys.integration.alert.service.email.enumeration.EmailPropertyKeys) Properties(java.util.Properties)

Aggregations

EmailPropertyKeys (com.synopsys.integration.alert.service.email.enumeration.EmailPropertyKeys)1 Properties (java.util.Properties)1