Class DefaultEmailService

java.lang.Object
it.ozimov.springboot.mail.service.defaultimpl.DefaultEmailService
All Implemented Interfaces:
EmailService

@Service public class DefaultEmailService extends Object implements EmailService
  • Constructor Details

    • DefaultEmailService

      @Autowired(required=false) public DefaultEmailService(@NonNull @NonNull org.springframework.mail.javamail.JavaMailSender javaMailSender, TemplateService templateService, @NonNull @NonNull EmailToMimeMessage emailToMimeMessage, @NonNull @NonNull EmailLogRenderer emailLogRenderer)
    • DefaultEmailService

      @Autowired(required=false) public DefaultEmailService(@NonNull @NonNull org.springframework.mail.javamail.JavaMailSender javaMailSender, @NonNull @NonNull EmailToMimeMessage emailToMimeMessage, @NonNull @NonNull EmailLogRenderer emailLogRenderer)
  • Method Details

    • send

      public jakarta.mail.internet.MimeMessage send(@NonNull @NonNull Email email)
      Description copied from interface: EmailService
      Send an email message.

      The send date is set or overridden if any is present.

      Specified by:
      send in interface EmailService
      Parameters:
      email - an email to be send
    • send

      public jakarta.mail.internet.MimeMessage send(@NonNull @NonNull Email email, @NonNull @NonNull String template, Map<String,Object> modelObject, @NonNull @NonNull InlinePicture... inlinePictures) throws CannotSendEmailException
      Description copied from interface: EmailService
      Send an email message.

      The body is ignored if present. The send date is set or overridden if any is present.

      Specified by:
      send in interface EmailService
      Parameters:
      email - an email to be send
      template - the reference to the template file
      modelObject - the model object to be used for the template engine, it may be null
      inlinePictures - list of pictures to be rendered inline in the template
      Throws:
      CannotSendEmailException