Interface MailService

All Known Implementing Classes:
MailServiceImpl

public interface MailService
This interface provides access to core Essentials mailing functions, allowing API users to send messages to IUser's .
  • Method Details

    • sendMail

      void sendMail(IUser recipient, MailSender sender, String message)
      Sends a message from the specified sender to the specified recipient.
      Parameters:
      recipient - The IUser which to send the message to.
      sender - The MailSender which sent the message.
      message - The message content.
    • sendMail

      void sendMail(IUser recipient, MailSender sender, String message, long expireAt)
      Sends a message from the specified sender to the specified recipient.
      Parameters:
      recipient - The IUser which to send the message to.
      sender - The MailSender which sent the message.
      message - The message content.
      expireAt - The millisecond epoch at which this message expires, or 0 if the message doesn't expire.
    • sendLegacyMail

      @Deprecated void sendLegacyMail(IUser recipient, String message)
      Deprecated.
      This is only for maintaining backwards compatibility with old API, please use the newer sendMail(IUser, MailSender, String) API.
      Sends a legacy message to the user without any advanced features.
      Parameters:
      recipient - The IUser which to send the message to.
      message - The message content.
      See Also:
    • getMailLine

      String getMailLine(MailMessage message)
      Generates the message sent to the recipient of the given MailMessage.
      Parameters:
      message - The MailMessage to generate the message for.
      Returns:
      The formatted message to be sent to the recipient.
    • getMailTlKey

      String getMailTlKey(MailMessage message)
      Helper method to get the translation key for a given MailMessage.
      Returns:
      the translation key.
    • getMailTlArgs

      Object[] getMailTlArgs(MailMessage message)
      Helper method to get the translation arguments for a given MailMessage.
      Returns:
      the translation arguments.