Package com.almis.awe.service
Class EmailService
java.lang.Object
com.almis.awe.config.ServiceConfig
com.almis.awe.service.EmailService
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
-
Constructor Summary
ConstructorDescriptionEmailService
(MailSenderFactory mailSenderFactory, BaseConfigProperties baseConfigProperties, QueryService queryService, QueryUtil queryUtil, UserDAOImpl userDAO) Autowired constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected void
generateMultipartAttachments
(ParsedEmail email, jakarta.mail.Multipart multipart) Append attachmentsprotected jakarta.mail.Multipart
Generate email message partsReload mail servers (when updated)void
sendEmail
(ParsedEmail email) protected void
setRecipients
(ParsedEmail email, jakarta.mail.internet.MimeMessage message) Set email recipientsMethods inherited from class com.almis.awe.config.ServiceConfig
containsBean, getApplicationContext, getBean, getBean, getElements, getLocale, getLocale, getProperty, getProperty, getRequest, getSession, setApplicationContext
-
Constructor Details
-
EmailService
public EmailService(MailSenderFactory mailSenderFactory, BaseConfigProperties baseConfigProperties, QueryService queryService, QueryUtil queryUtil, UserDAOImpl userDAO) Autowired constructor- Parameters:
mailSenderFactory
- Email sender factorybaseConfigProperties
- Base configuration properties
-
-
Method Details
-
sendEmail
@Async("threadPoolTaskExecutor") public Future<ServiceData> sendEmail(String emailName, com.fasterxml.jackson.databind.node.ObjectNode parameters) throws AWException - Throws:
AWException
-
sendEmail
-
reloadMailServers
Reload mail servers (when updated)- Returns:
- Throws:
AWException
-
generateMultipartMessage
protected jakarta.mail.Multipart generateMultipartMessage(ParsedEmail email) throws jakarta.mail.MessagingException, IOException Generate email message parts- Returns:
- Multipart
- Throws:
jakarta.mail.MessagingException
- Error generating messageIOException
- Error retrieving file
-
generateMultipartAttachments
protected void generateMultipartAttachments(ParsedEmail email, jakarta.mail.Multipart multipart) throws jakarta.mail.MessagingException, IOException Append attachments- Parameters:
multipart
- Attachments- Throws:
jakarta.mail.MessagingException
- Message exceptionIOException
- IO exception
-
setRecipients
protected void setRecipients(ParsedEmail email, jakarta.mail.internet.MimeMessage message) throws jakarta.mail.MessagingException Set email recipients- Parameters:
email
- Emailmessage
- Mime message- Throws:
jakarta.mail.MessagingException
- Error generating email
-