Class SmtpMailNotificationHandler

java.lang.Object
es.kukenan.smartfi.microservice.backoffice.service.communication.SmtpMailNotificationHandler

@Component public class SmtpMailNotificationHandler extends Object
Service class that holds all the mail notification sending bussiness logic.
  • Field Details

    • mailFrom

      @Value("${spring.mail.username}") private String mailFrom
      SMTP mail sender.
    • mailSender

      @Autowired private org.springframework.mail.javamail.JavaMailSender mailSender
      Smtp Rest client.
  • Constructor Details

    • SmtpMailNotificationHandler

      public SmtpMailNotificationHandler()
  • Method Details

    • send

      public void send(String destination, String name, String subject, String title, String msg)
      Send a notification.
      Parameters:
      destination - user email destination.
      name - user name.
      subject - email subject.
      title - email title.
      msg - email content.
    • loadhtmlFile

      private String loadhtmlFile() throws IOException
      Load HTML template from file.
      Returns:
      HTML string template.
      Throws:
      IOException - if getResource from ResourceLoader fails.