Interface EmailProfile

All Known Subinterfaces:
EmailProfile.Lifecycle, EmailProfile.Managed, SmtpEmailProfile

public interface EmailProfile
An EmailProfile exposes methods for sending emails.
  • Method Details

    • sendEmail

      void sendEmail(EmailMessage message) throws Exception
      Send a new email using this profile.
      Parameters:
      message - the EmailMessage to send
      Throws:
      Exception - if there was a problem sending the email. most profile types will throw an exception if the provided message argument has an empty "from", "contentType", or "toRecipients" field values
    • getAsSmtpEmailProfile

      default Optional<? extends SmtpEmailProfile> getAsSmtpEmailProfile()
      Returns:
      an Optional containing this EmailProfile as an SmtpEmailProfile if this profile supports SMTP. the returned Optional will be empty if this profile does not support SMTP.