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

public class EmailService extends ServiceConfig
  • Constructor Details

    • EmailService

      public EmailService(org.springframework.mail.javamail.JavaMailSender mailSender, XMLEmailBuilder emailBuilder, BaseConfigProperties baseConfigProperties)
      Autowired constructor
      Parameters:
      mailSender - Email sender
      emailBuilder - Email builder
      baseConfigProperties - Base configuration properties
  • Method Details

    • sendEmail

      @Async("contextlessTaskExecutor") public Future<ServiceData> sendEmail(String emailName, com.fasterxml.jackson.databind.node.ObjectNode parameters) throws AWException
      Throws:
      AWException
    • sendEmail

      @Async("contextlessTaskExecutor") public void sendEmail(ParsedEmail email)
    • generateMultipartMessage

      protected javax.mail.Multipart generateMultipartMessage(ParsedEmail email) throws javax.mail.MessagingException, IOException
      Generate email message parts
      Returns:
      Multipart
      Throws:
      javax.mail.MessagingException - Error generating message
      IOException - Error retrieving file
    • generateMultipartAttachments

      protected void generateMultipartAttachments(ParsedEmail email, javax.mail.Multipart multipart) throws javax.mail.MessagingException, IOException
      Append attachments
      Parameters:
      multipart - Attachments
      Throws:
      javax.mail.MessagingException - Message exception
      IOException - IO exception
    • setRecipients

      protected void setRecipients(ParsedEmail email, javax.mail.internet.MimeMessage message) throws javax.mail.MessagingException
      Set email recipients
      Parameters:
      email - Email
      message - Mime message
      Throws:
      javax.mail.MessagingException - Error generating email