br.com.jhonsapp.email.producer.SessionConfigProducer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of email-dispatcher Show documentation
Show all versions of email-dispatcher Show documentation
Email Dispatcher is an open source project created by Jhonys Camacho and Jhonathan Camacho to facilitate the sending of emails.
package br.com.jhonsapp.email.producer;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import com.outjected.email.api.SessionConfig;
import com.outjected.email.impl.SimpleMailConfig;
import br.com.jhonsapp.email.session.configurator.SenderConfigurator;
import br.com.jhonsapp.email.session.configurator.ServerConfigurator;
/**
* Class responsible for producing SessionConfig.
*
* @see SessionConfig
*
* @author Jhonathan Camacho
*
*/
@Component
public class SessionConfigProducer {
@Bean
public SessionConfig sessionConfig() {
SimpleMailConfig simpleMailConfig = new SimpleMailConfig();
senderConfigurator().configure(simpleMailConfig);
serverConfigurator().configure(simpleMailConfig);
return simpleMailConfig;
}
@Bean
public ServerConfigurator serverConfigurator(){
return new ServerConfigurator();
}
@Bean
public SenderConfigurator senderConfigurator(){
return new SenderConfigurator();
}
}