Search in sources :

Example 1 with SmtpConfigurationBuilder

use of io.lumeer.core.task.executor.request.SmtpConfigurationBuilder in project engine by Lumeer.

the class LumeerBridge method getSmtpConfiguration.

private SmtpConfiguration getSmtpConfiguration(final Value smtpConfig) {
    if (smtpConfig != null && smtpConfig.hasMembers()) {
        final SmtpConfigurationBuilder smtpConfigurationBuilder = new SmtpConfigurationBuilder();
        smtpConfigurationBuilder.setHost(smtpConfig.hasMember("host") ? smtpConfig.getMember("host").asString() : "");
        smtpConfigurationBuilder.setPort(smtpConfig.hasMember("port") ? smtpConfig.getMember("port").asInt() : 0);
        smtpConfigurationBuilder.setUser(smtpConfig.hasMember("user") ? smtpConfig.getMember("user").asString() : "");
        smtpConfigurationBuilder.setPassword(smtpConfig.hasMember("password") ? smtpConfig.getMember("password").asString() : "");
        smtpConfigurationBuilder.setFrom(smtpConfig.hasMember("from") ? smtpConfig.getMember("from").asString() : "");
        smtpConfigurationBuilder.setEmailSecurityType(smtpConfig.hasMember("security") ? EmailSecurityType.valueOf(smtpConfig.getMember("security").asString()) : EmailSecurityType.NONE);
        return smtpConfigurationBuilder.build();
    }
    return null;
}
Also used : SmtpConfigurationBuilder(io.lumeer.core.task.executor.request.SmtpConfigurationBuilder)

Aggregations

SmtpConfigurationBuilder (io.lumeer.core.task.executor.request.SmtpConfigurationBuilder)1