Package best.skn.mail.services.impls
Class MailSenderServiceImpl
java.lang.Object
best.skn.mail.services.impls.MailSenderServiceImpl
- All Implemented Interfaces:
MailSenderService
Mail Sender Service Implementation Class
- Since:
- 2024-05-29
- Version:
- 2.0.1
- Author:
- SKN Shukhan
- Use Case:
- Spring Boot Reactive
- Dedicated To:
- Logno, Atoshi and My Parents
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.springframework.mail.javamail.JavaMailSenderPrivate Java Mail Sender objectprivate org.thymeleaf.TemplateEngineprivate Thymeleaf Template Engine object -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<String> Method to send basic mailreactor.core.publisher.Mono<String> sendMailWithAttachment(MailSenderRequestInfo info, MailSenderInputStream stream) Method to send basic mail with attachmentreactor.core.publisher.Mono<String> sendMailWithHtmlTemplate(MailSenderRequestInfo info, MailSenderHtmlTemplate template) Method to send mail with HTML templatereactor.core.publisher.Mono<String> sendMailWithHtmlTemplateAndAttachment(MailSenderRequestInfo info, MailSenderHtmlTemplate template, MailSenderInputStream stream) Method to send mail with HTML template and attachment
-
Field Details
-
mailSender
@Autowired private org.springframework.mail.javamail.JavaMailSender mailSenderPrivate Java Mail Sender object- Since:
- v2.0.0
-
templateEngine
@Autowired private org.thymeleaf.TemplateEngine templateEngineprivate Thymeleaf Template Engine object- Since:
- v2.0.0
-
-
Constructor Details
-
MailSenderServiceImpl
public MailSenderServiceImpl()
-
-
Method Details
-
sendMail
public reactor.core.publisher.Mono<String> sendMail(MailSenderRequestInfo info) throws jakarta.mail.MessagingException Description copied from interface:MailSenderServiceMethod to send basic mail- Specified by:
sendMailin interfaceMailSenderService- Parameters:
info- MailSenderRequestInfo object that contains all the information regarding sending mail- Returns:
- a Mono of String as a response
- Throws:
jakarta.mail.MessagingException- an exception is thrown if an error occurs while sending mail
-
sendMailWithAttachment
public reactor.core.publisher.Mono<String> sendMailWithAttachment(MailSenderRequestInfo info, MailSenderInputStream stream) throws jakarta.mail.MessagingException, IOException Description copied from interface:MailSenderServiceMethod to send basic mail with attachment- Specified by:
sendMailWithAttachmentin interfaceMailSenderService- Parameters:
info- MailSenderRequestInfo object that contains all the information regarding sending mailstream- MailSenderInputStream object that contains all the information regarding input stream- Returns:
- a Mono of String as a response
- Throws:
jakarta.mail.MessagingException- an exception is thrown if an error occurs while sending mailIOException- an exception is thrown if an error occurs in file attachment
-
sendMailWithHtmlTemplate
public reactor.core.publisher.Mono<String> sendMailWithHtmlTemplate(MailSenderRequestInfo info, MailSenderHtmlTemplate template) throws jakarta.mail.MessagingException Description copied from interface:MailSenderServiceMethod to send mail with HTML template- Specified by:
sendMailWithHtmlTemplatein interfaceMailSenderService- Parameters:
info- MailSenderRequestInfo object that contains all the information regarding sending mailtemplate- MailSenderHtmlTemplate object that contains all the information regarding thymeleaf- Returns:
- a Mono of String as a response
- Throws:
jakarta.mail.MessagingException- an exception is thrown if an error occurs while sending mail
-
sendMailWithHtmlTemplateAndAttachment
public reactor.core.publisher.Mono<String> sendMailWithHtmlTemplateAndAttachment(MailSenderRequestInfo info, MailSenderHtmlTemplate template, MailSenderInputStream stream) throws jakarta.mail.MessagingException, IOException Description copied from interface:MailSenderServiceMethod to send mail with HTML template and attachment- Specified by:
sendMailWithHtmlTemplateAndAttachmentin interfaceMailSenderService- Parameters:
info- MailSenderRequestInfo object that contains all the information regarding sending mailtemplate- MailSenderHtmlTemplate object that contains all the information regarding thymeleafstream- MailSenderInputStream object that contains all the information regarding input stream- Returns:
- a Mono of String as a response
- Throws:
jakarta.mail.MessagingException- an exception is thrown if an error occurs while sending mailIOException- an exception is thrown if an error occurs in file attachment
-