Interface MailService

All Known Implementing Classes:
MailServiceImpl

public interface MailService
The mail service defines interface for sending/reading mails.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Fetch mails from remote mail server.
    List<jakarta.mail.internet.InternetAddress>
    findEmails(String matching, List<String> selected, int maxResults)
    Search for email addresses matching the given text.
    resolve(String email)
    Resolve the given email address to an associated entity.
    void
    send(MailMessage message)
    Send a mail for the given MailMessage.
  • Method Details

    • send

      void send(MailMessage message) throws MailException
      Send a mail for the given MailMessage.
      Parameters:
      message - the message to send
      Throws:
      MailException - on failure
    • fetch

      void fetch() throws MailException
      Fetch mails from remote mail server.
      Throws:
      MailException - on failure
    • resolve

      Model resolve(String email)
      Resolve the given email address to an associated entity.

      Generally, it should resolve to the User, Contact, Partner or Customer that represents a contact.

      The default implementation resolves to the User records.

      Parameters:
      email - the email address to resolve
      Returns:
      associated entity or null if can't be resolved
    • findEmails

      List<jakarta.mail.internet.InternetAddress> findEmails(String matching, List<String> selected, int maxResults)
      Search for email addresses matching the given text.
      Parameters:
      matching - the match text
      selected - already selected email addresses
      maxResults - maximum number of items to return
      Returns:
      list of InternetAddress