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, javax.mail.internet.MimeMessage msg) protected void
assignRecipient
(javax.mail.Message.RecipientType type, String addresses, javax.mail.internet.MimeMessage message) protected javax.mail.internet.MimeBodyPart
createAttachmentPart
(SendingAttachment attachment) protected javax.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, javax.mail.internet.MimeMultipart content, javax.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:
javax.mail.MessagingException
- if delivery fails
-
createMimeMessage
protected javax.mail.internet.MimeMessage createMimeMessage(SendingMessage sendingMessage) throws javax.mail.MessagingException - Throws:
javax.mail.MessagingException
-
setMimeMessageContent
protected void setMimeMessageContent(SendingMessage sendingMessage, javax.mail.internet.MimeMultipart content, javax.mail.internet.MimeMultipart textPart) throws javax.mail.MessagingException - Throws:
javax.mail.MessagingException
-
assignRecipient
protected void assignRecipient(javax.mail.Message.RecipientType type, String addresses, javax.mail.internet.MimeMessage message) throws javax.mail.MessagingException - Throws:
javax.mail.MessagingException
-
splitAddresses
-
assignFromAddress
protected void assignFromAddress(SendingMessage sendingMessage, javax.mail.internet.MimeMessage msg) throws javax.mail.MessagingException - Throws:
javax.mail.MessagingException
-
createAttachmentPart
protected javax.mail.internet.MimeBodyPart createAttachmentPart(SendingAttachment attachment) throws javax.mail.MessagingException - Throws:
javax.mail.MessagingException
-
generateAttachmentContentId
-