Interface Emailer
- All Known Implementing Classes:
MockEmailer
public interface Emailer
An email service. Used for sending emails.
- Author:
- Alex Bogdanovski [[email protected]]
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.slf4j.LoggerLogger.static final int50. -
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetFromEmail(App app) Returns the sender email for a particular app.default StringgetFromName(App app) Returns the sender name for an app (i.e. the app name).default booleanSends an email.default booleansendEmail(App app, List<String> emails, String subject, String body, InputStream attachment, String mimeType, String fileName) Sends an email.default booleanSends an email.default booleansendEmail(List<String> emails, String subject, String body, InputStream attachment, String mimeType, String fileName) Sends an email.voidsendSingleBatch(App app, List<String> emails, String subject, String body, jakarta.mail.util.ByteArrayDataSource attachment, String fileName) Sends a single email message to a batch of email addresses (max. 100).default voidsendSingleBatch(List<String> emails, String subject, String body, jakarta.mail.util.ByteArrayDataSource attachment, String fileName) Sends a single email message to a batch of email addresses (max. 100).
-
Field Details
-
logger
static final org.slf4j.Logger loggerLogger. -
MAX_RECIPIENTS_PER_MESSAGE
static final int MAX_RECIPIENTS_PER_MESSAGE50.- See Also:
-
-
Method Details
-
sendEmail
-
sendEmail
Sends an email.- Parameters:
app- the app where mailer configuration is loaded fromemails- a list of email addresses (recipients)subject- the subject of the messagebody- the body of the message- Returns:
- true if the message was sent
-
sendEmail
default boolean sendEmail(List<String> emails, String subject, String body, InputStream attachment, String mimeType, String fileName) Sends an email.- Parameters:
emails- a list of email addresses (recipients)subject- the subject of the messagebody- the body of the messageattachment- attachmentmimeType- attachment MIME typefileName- attachment file name- Returns:
- true if the message was sent
-
sendEmail
default boolean sendEmail(App app, List<String> emails, String subject, String body, InputStream attachment, String mimeType, String fileName) Sends an email.- Parameters:
app- the app where mailer configuration is loaded fromemails- a list of email addresses (recipients)subject- the subject of the messagebody- the body of the messageattachment- attachmentmimeType- attachment MIME typefileName- attachment file name- Returns:
- true if the message was sent
-
sendSingleBatch
default void sendSingleBatch(List<String> emails, String subject, String body, jakarta.mail.util.ByteArrayDataSource attachment, String fileName) Sends a single email message to a batch of email addresses (max. 100).- Parameters:
emails- a list of email addresses (recipients)subject- the subject of the messagebody- the body of the messageattachment- attachmentfileName- attachment file name
-
sendSingleBatch
void sendSingleBatch(App app, List<String> emails, String subject, String body, jakarta.mail.util.ByteArrayDataSource attachment, String fileName) Sends a single email message to a batch of email addresses (max. 100).- Parameters:
app- the app where mailer configuration is loaded fromemails- a list of email addresses (recipients)subject- the subject of the messagebody- the body of the messageattachment- attachmentfileName- attachment file name
-
getFromEmail
-
getFromName
-