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 Summary
Modifier and TypeMethodDescriptiongetMailLine
(MailMessage message) Generates the message sent to the recipient of the givenMailMessage
.Object[]
getMailTlArgs
(MailMessage message) Helper method to get the translation arguments for a givenMailMessage
.getMailTlKey
(MailMessage message) Helper method to get the translation key for a givenMailMessage
.void
sendLegacyMail
(IUser recipient, String message) Deprecated.void
sendMail
(IUser recipient, MailSender sender, String message) void
sendMail
(IUser recipient, MailSender sender, String message, long expireAt)
-
Method Details
-
sendMail
- Parameters:
recipient
- TheIUser
which to send the message to.sender
- TheMailSender
which sent the message.message
- The message content.
-
sendMail
- Parameters:
recipient
- TheIUser
which to send the message to.sender
- TheMailSender
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.This is only for maintaining backwards compatibility with old API, please use the newersendMail(IUser, MailSender, String)
API.Sends a legacy message to the user without any advanced features.- Parameters:
recipient
- TheIUser
which to send the message to.message
- The message content.- See Also:
-
getMailLine
Generates the message sent to the recipient of the givenMailMessage
.- Parameters:
message
- TheMailMessage
to generate the message for.- Returns:
- The formatted message to be sent to the recipient.
-
getMailTlKey
Helper method to get the translation key for a givenMailMessage
.- Returns:
- the translation key.
-
getMailTlArgs
Helper method to get the translation arguments for a givenMailMessage
.- Returns:
- the translation arguments.
-
sendMail(IUser, MailSender, String)
API.