Interface Emailer

All Known Implementing Classes:
MockEmailer

public interface Emailer
An email service. Used for sending emails.
Author:
Alex Bogdanovski [[email protected]]
  • Field Details

    • logger

      static final org.slf4j.Logger logger
      Logger.
    • MAX_RECIPIENTS_PER_MESSAGE

      static final int MAX_RECIPIENTS_PER_MESSAGE
      50.
      See Also:
  • Method Details

    • sendEmail

      default boolean sendEmail(List<String> emails, String subject, String body)
      Sends an email.
      Parameters:
      emails - a list of email addresses (recipients)
      subject - the subject of the message
      body - the body of the message
      Returns:
      true if the message was sent
    • sendEmail

      default boolean sendEmail(App app, List<String> emails, String subject, String body)
      Sends an email.
      Parameters:
      app - the app where mailer configuration is loaded from
      emails - a list of email addresses (recipients)
      subject - the subject of the message
      body - 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 message
      body - the body of the message
      attachment - attachment
      mimeType - attachment MIME type
      fileName - 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 from
      emails - a list of email addresses (recipients)
      subject - the subject of the message
      body - the body of the message
      attachment - attachment
      mimeType - attachment MIME type
      fileName - 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 message
      body - the body of the message
      attachment - attachment
      fileName - 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 from
      emails - a list of email addresses (recipients)
      subject - the subject of the message
      body - the body of the message
      attachment - attachment
      fileName - attachment file name
    • getFromEmail

      default String getFromEmail(App app)
      Returns the sender email for a particular app.
      Parameters:
      app - app
      Returns:
      email
    • getFromName

      default String getFromName(App app)
      Returns the sender name for an app (i.e. the app name).
      Parameters:
      app - app
      Returns:
      app name