public class MailServiceImpl extends java.lang.Object implements MailService
Modifier and Type | Class and Description |
---|---|
static interface |
MailServiceImpl.MailSupervisor |
class |
MailServiceImpl.MailSupervisorImpl |
Constructor and Description |
---|
MailServiceImpl(<any> defaultSessionProvider,
<any> emailDatasinkSessionFactory,
<any> simpleMailFactoryProvider,
<any> simpleCryptoMailFactoryProvider,
CryptoService cryptoService,
<any> simpleJuelProvider,
<any> eventBus,
<any> emailDatasinkServiceProvider,
<any> datasinkServiceProvider,
<any> deprecatedMailConfigProvider,
<any> deprecatedMailFromProvider,
<any> deprecatedMailFromNameProvider) |
Modifier and Type | Method and Description |
---|---|
java.util.List<Address> |
getEmailList(java.util.List<User> users) |
InternetAddress |
getMailFrom(User user,
java.util.Optional<EmailDatasink> datasink) |
SimpleMail |
newSimpleMail()
Creates and returns a new instance of
SimpleMail |
SimpleMail |
newSimpleMail(java.util.Optional<EmailDatasink> emailDatasink) |
SimpleMail |
newTemplateMail(MailTemplate template,
SimpleAttachment... attachments)
Creates and returns a new instance of
SimpleMail configured with the
given template |
SimpleMail |
newTemplateMail(java.util.Optional<EmailDatasink> emailDatasink,
MailTemplate template,
SimpleAttachment... attachments) |
void |
sendMail(MimeMessage message)
Spawns a new worker which then sends the message
|
void |
sendMail(MimeMessage message,
MailServiceImpl.MailSupervisor supervisor) |
void |
sendMail(java.util.Optional<EmailDatasink> emailDatasink,
MimeMessage message) |
void |
sendMail(java.util.Optional<EmailDatasink> emailDatasink,
MimeMessage message,
MailServiceImpl.MailSupervisor supervisor) |
void |
sendMailSync(MimeMessage message)
Sends a mail synchronously
|
void |
sendMailSync(MimeMessage message,
MailServiceImpl.MailSupervisor supervisor) |
void |
sendMailSync(java.util.Optional<EmailDatasink> emailDatasink,
MimeMessage message) |
void |
sendMailSync(java.util.Optional<EmailDatasink> emailDatasink,
MimeMessage message,
MailServiceImpl.MailSupervisor supervisor) |
public MailServiceImpl(<any> defaultSessionProvider, <any> emailDatasinkSessionFactory, <any> simpleMailFactoryProvider, <any> simpleCryptoMailFactoryProvider, CryptoService cryptoService, <any> simpleJuelProvider, <any> eventBus, <any> emailDatasinkServiceProvider, <any> datasinkServiceProvider, <any> deprecatedMailConfigProvider, <any> deprecatedMailFromProvider, <any> deprecatedMailFromNameProvider)
public SimpleMail newSimpleMail()
MailService
SimpleMail
newSimpleMail
in interface MailService
SimpleCryptoMail
, else a new instance of SimpleMail
public SimpleMail newSimpleMail(java.util.Optional<EmailDatasink> emailDatasink)
newSimpleMail
in interface MailService
public SimpleMail newTemplateMail(MailTemplate template, SimpleAttachment... attachments)
MailService
SimpleMail
configured with the
given templatenewTemplateMail
in interface MailService
template
- The MailTemplate
to useSimpleMail
using the given
MailTemplate
public SimpleMail newTemplateMail(java.util.Optional<EmailDatasink> emailDatasink, MailTemplate template, SimpleAttachment... attachments)
newTemplateMail
in interface MailService
public void sendMailSync(MimeMessage message)
MailService
sendMailSync
in interface MailService
message
- The MimeMessage
to sendpublic void sendMailSync(MimeMessage message, MailServiceImpl.MailSupervisor supervisor)
sendMailSync
in interface MailService
public void sendMailSync(java.util.Optional<EmailDatasink> emailDatasink, MimeMessage message)
sendMailSync
in interface MailService
public void sendMailSync(java.util.Optional<EmailDatasink> emailDatasink, MimeMessage message, MailServiceImpl.MailSupervisor supervisor)
sendMailSync
in interface MailService
public void sendMail(MimeMessage message)
MailService
sendMail
in interface MailService
message
- The MimeMessage
to sendpublic void sendMail(java.util.Optional<EmailDatasink> emailDatasink, MimeMessage message)
sendMail
in interface MailService
public void sendMail(MimeMessage message, MailServiceImpl.MailSupervisor supervisor)
sendMail
in interface MailService
public void sendMail(java.util.Optional<EmailDatasink> emailDatasink, MimeMessage message, MailServiceImpl.MailSupervisor supervisor)
sendMail
in interface MailService
public java.util.List<Address> getEmailList(java.util.List<User> users) throws AddressException
getEmailList
in interface MailService
AddressException
public InternetAddress getMailFrom(User user, java.util.Optional<EmailDatasink> datasink)
getMailFrom
in interface MailService