Interface EmailProfile
-
- All Known Subinterfaces:
EmailProfile.Lifecycle
,EmailProfile.Managed
,SmtpEmailProfile
public interface EmailProfile
An EmailProfile exposes methods for sending emails.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
EmailProfile.Lifecycle
AnEmailProfile
which exposes additional methods for the Platform to drive the profile's lifecycle.static interface
EmailProfile.Managed
AnEmailProfile
managed by the Platform.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.Optional<? extends SmtpEmailProfile>
getAsSmtpEmailProfile()
void
sendEmail(EmailMessage message)
Send a new email using this profile.
-
-
-
Method Detail
-
sendEmail
void sendEmail(EmailMessage message) throws java.lang.Exception
Send a new email using this profile.- Parameters:
message
- theEmailMessage
to send- Throws:
java.lang.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 java.util.Optional<? extends SmtpEmailProfile> getAsSmtpEmailProfile()
- Returns:
- an
Optional
containing thisEmailProfile
as anSmtpEmailProfile
if this profile supports SMTP. the returned Optional will be empty if this profile does not support SMTP.
-
-