Class EmailSenderImpl

java.lang.Object
io.jmix.email.impl.EmailSenderImpl
All Implemented Interfaces:
EmailSender

@Component("email_EmailSender") public class EmailSenderImpl extends Object implements EmailSender
  • Field Details

    • mailSender

      @Autowired protected org.springframework.mail.javamail.JavaMailSender mailSender
    • timeSource

      @Autowired protected TimeSource timeSource
    • coreProperties

      @Autowired protected CoreProperties coreProperties
    • meterRegistry

      @Autowired protected io.micrometer.core.instrument.MeterRegistry meterRegistry
  • Constructor Details

    • EmailSenderImpl

      public EmailSenderImpl()
  • Method Details

    • sendEmail

      public void sendEmail(SendingMessage sendingMessage) throws jakarta.mail.MessagingException
      Description copied from interface: EmailSender
      Sends email with help of JavaMailSender. Message body and attachments' content must be loaded from file storage.
      Use Emailer instead if you need email to be delivered reliably and stored to email history.
      Specified by:
      sendEmail in interface EmailSender
      Throws:
      jakarta.mail.MessagingException - if delivery fails
    • createMimeMessage

      protected jakarta.mail.internet.MimeMessage createMimeMessage(SendingMessage sendingMessage) throws jakarta.mail.MessagingException
      Throws:
      jakarta.mail.MessagingException
    • setMimeMessageContent

      protected void setMimeMessageContent(SendingMessage sendingMessage, jakarta.mail.internet.MimeMultipart content, jakarta.mail.internet.MimeMultipart textPart) throws jakarta.mail.MessagingException
      Throws:
      jakarta.mail.MessagingException
    • assignRecipient

      protected void assignRecipient(jakarta.mail.Message.RecipientType type, String addresses, jakarta.mail.internet.MimeMessage message) throws jakarta.mail.MessagingException
      Throws:
      jakarta.mail.MessagingException
    • splitAddresses

      protected Iterable<String> splitAddresses(String addresses)
    • assignFromAddress

      protected void assignFromAddress(SendingMessage sendingMessage, jakarta.mail.internet.MimeMessage msg) throws jakarta.mail.MessagingException
      Throws:
      jakarta.mail.MessagingException
    • createAttachmentPart

      protected jakarta.mail.internet.MimeBodyPart createAttachmentPart(SendingAttachment attachment) throws jakarta.mail.MessagingException
      Throws:
      jakarta.mail.MessagingException
    • generateAttachmentContentId

      protected String generateAttachmentContentId(String attachmentName)