com.heanbian.boot.autoconfigure.email.EmailAutoConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of heanbian-spring-boot-autoconfigure Show documentation
Show all versions of heanbian-spring-boot-autoconfigure Show documentation
Heanbian spring boot autoconfigure component.
package com.heanbian.boot.autoconfigure.email;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.heanbian.block.email.EmailConfig;
import com.heanbian.block.email.EmailTemplate;
@Configuration
@EnableConfigurationProperties(EmailProperties.class)
public class EmailAutoConfiguration {
@Bean
@ConditionalOnProperty(prefix = "heanbian.email", name = "enabled", havingValue = "true")
public EmailTemplate emailTemplate(EmailProperties ep) {
return new EmailTemplate(new EmailConfig(ep.getHost(), ep.getPort(), ep.getUsername(), ep.getPassword(),
ep.getFrom(), ep.isDebug()));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy