Class MailService


  • @Service
    public class MailService
    extends Object
    Service for sending emails.

    We use the Async annotation to send emails asynchronously.

    • Constructor Detail

      • MailService

        public MailService​(io.github.jhipster.config.JHipsterProperties jHipsterProperties,
                           org.springframework.mail.javamail.JavaMailSender javaMailSender,
                           org.springframework.context.MessageSource messageSource,
                           org.thymeleaf.spring5.SpringTemplateEngine templateEngine)
    • Method Detail

      • sendEmail

        @Async
        public void sendEmail​(String to,
                              String subject,
                              String content,
                              boolean isMultipart,
                              boolean isHtml)
      • sendEmailFromTemplate

        @Async
        public void sendEmailFromTemplate​(org.thymeleaf.context.Context context,
                                          User user,
                                          String templateName,
                                          String titleKey)
      • sendEmailFromTemplate

        @Async
        public void sendEmailFromTemplate​(org.thymeleaf.context.Context context,
                                          User user,
                                          String templateName,
                                          String titleKey,
                                          String[] args)
      • sendEmailFromTemplate

        @Async
        public void sendEmailFromTemplate​(User user,
                                          String templateName,
                                          String titleKey)
      • sendActivationEmail

        @Async
        public void sendActivationEmail​(User user)
      • sendCreationEmail

        @Async
        public void sendCreationEmail​(User user)
      • sendPasswordResetMail

        @Async
        public void sendPasswordResetMail​(User user)