Package org.europa.together.service
Class MailClientService
java.lang.Object
org.europa.together.service.MailClientService
Service implementation for the JakartaMailClient.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- elmar.dott@gmail.com
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the active configuration for the e-mail service and return the result as Map.int
sendBulkMail
(Mail mail) Send a bulk of composed mails to a configured list of recipients.void
Send an composed (single) e-mail which is configured in a Mail data class.void
updateConfiguration
(Map<String, String> configurationList) Allows to update the database configuration for the MailClient by a map of configuration entries.
mailer.host mailer.port mailer.sender mailer.user mailer.password mailer.ssl mailer.tls mailer.debug mailer.count mailer.wait
-
Constructor Details
-
MailClientService
@API(status=STABLE, since="1.0") public MailClientService()Constructor.
-
-
Method Details
-
updateConfiguration
@API(status=STABLE, since="3.0") public void updateConfiguration(Map<String, String> configurationList) Allows to update the database configuration for the MailClient by a map of configuration entries.
- mailer.host
- mailer.port
- mailer.sender
- mailer.user
- mailer.password
- mailer.ssl
- mailer.tls
- mailer.debug
- mailer.count
- mailer.wait
- Parameters:
configurationList
- as Map
-
loadConfiguration
Get the active configuration for the e-mail service and return the result as Map.- Returns:
- mailConfiguration as Map
-
sendEmail
Send an composed (single) e-mail which is configured in a Mail data class. An e-mail can be configured as followed:
Mail mail = new Mail(); mail.setSubject(subject); mail.setMessage(content); mail.addRecipent(mailAdress);
In the case there are more recipients configured the mail will be only send to the first entry.- Parameters:
mail
- as MailClient
-
sendBulkMail
Send a bulk of composed mails to a configured list of recipients. The bulk mail supports a special feature, to interrupt the sending after an defined amount of mails fo a configured time (milliseconds) until the next bulk can be send. After the termination the method return th count of the send mails. This two parameters are also part of thw whole configuration and will not set seperatly.- wait time: default = -1 (unlimited)
- bulk mail limiter: default = -1 (unlimited)
- Parameters:
mail
- as MailClient- Returns:
- sendedEmails as int
-