Class MailService

  • All Implemented Interfaces:
    IMailService

    @Service
    public class MailService
    extends java.lang.Object
    implements IMailService
    • Field Detail

      • port

        @Value("${nae.mail.redirect-to.port}")
        protected java.lang.String port
      • domain

        @Value("${nae.mail.redirect-to.host}")
        protected java.lang.String domain
      • ssl

        @Value("${nae.mail.redirect-to.ssl}")
        protected boolean ssl
      • mailFrom

        @Value("${nae.mail.from}")
        protected java.lang.String mailFrom
      • mailSender

        protected org.springframework.mail.javamail.JavaMailSender mailSender
      • configuration

        protected freemarker.template.Configuration configuration
    • Constructor Detail

      • MailService

        public MailService()
    • Method Detail

      • sendRegistrationEmail

        public void sendRegistrationEmail​(RegisteredUser user)
                                   throws javax.mail.MessagingException,
                                          java.io.IOException,
                                          freemarker.template.TemplateException
        Specified by:
        sendRegistrationEmail in interface IMailService
        Throws:
        javax.mail.MessagingException
        java.io.IOException
        freemarker.template.TemplateException
      • sendPasswordResetEmail

        public void sendPasswordResetEmail​(RegisteredUser user)
                                    throws javax.mail.MessagingException,
                                           java.io.IOException,
                                           freemarker.template.TemplateException
        Specified by:
        sendPasswordResetEmail in interface IMailService
        Throws:
        javax.mail.MessagingException
        java.io.IOException
        freemarker.template.TemplateException
      • sendMail

        public void sendMail​(MailDraft mailDraft)
                      throws javax.mail.MessagingException,
                             java.io.IOException,
                             freemarker.template.TemplateException
        Specified by:
        sendMail in interface IMailService
        Throws:
        javax.mail.MessagingException
        java.io.IOException
        freemarker.template.TemplateException
      • buildEmail

        protected javax.mail.internet.MimeMessage buildEmail​(MailDraft draft)
                                                      throws javax.mail.MessagingException,
                                                             java.io.IOException,
                                                             freemarker.template.TemplateException
        Throws:
        javax.mail.MessagingException
        java.io.IOException
        freemarker.template.TemplateException
      • getServerURL

        protected java.lang.String getServerURL()