Package io.jmix.email.impl
Class EmailSenderImpl
java.lang.Object
io.jmix.email.impl.EmailSenderImpl
- All Implemented Interfaces:
EmailSender
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected CoreProperties
protected org.springframework.mail.javamail.JavaMailSender
protected io.micrometer.core.instrument.MeterRegistry
protected TimeSource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
assignFromAddress
(SendingMessage sendingMessage, jakarta.mail.internet.MimeMessage msg) protected void
assignRecipient
(jakarta.mail.Message.RecipientType type, String addresses, jakarta.mail.internet.MimeMessage message) protected jakarta.mail.internet.MimeBodyPart
createAttachmentPart
(SendingAttachment attachment) protected jakarta.mail.internet.MimeMessage
createMimeMessage
(SendingMessage sendingMessage) protected String
generateAttachmentContentId
(String attachmentName) void
sendEmail
(SendingMessage sendingMessage) Sends email with help ofJavaMailSender
.protected void
setMimeMessageContent
(SendingMessage sendingMessage, jakarta.mail.internet.MimeMultipart content, jakarta.mail.internet.MimeMultipart textPart) splitAddresses
(String addresses)
-
Field Details
-
mailSender
@Autowired protected org.springframework.mail.javamail.JavaMailSender mailSender -
timeSource
-
coreProperties
-
meterRegistry
@Autowired protected io.micrometer.core.instrument.MeterRegistry meterRegistry
-
-
Constructor Details
-
EmailSenderImpl
public EmailSenderImpl()
-
-
Method Details
-
sendEmail
Description copied from interface:EmailSender
Sends email with help ofJavaMailSender
. Message body and attachments' content must be loaded from file storage.
UseEmailer
instead if you need email to be delivered reliably and stored to email history.- Specified by:
sendEmail
in interfaceEmailSender
- 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
-
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
-