Interface EmailProfile
- All Known Subinterfaces:
EmailProfile.Lifecycle
,EmailProfile.Managed
,SmtpEmailProfile
public interface EmailProfile
An EmailProfile exposes methods for sending emails.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
AnEmailProfile
which exposes additional methods for the Platform to drive the profile's lifecycle.static interface
AnEmailProfile
managed by the Platform. -
Method Summary
Modifier and TypeMethodDescriptiondefault Optional<? extends SmtpEmailProfile>
void
sendEmail
(EmailMessage message) Send a new email using this profile.
-
Method Details
-
sendEmail
Send a new email using this profile.- Parameters:
message
- theEmailMessage
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
- 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.
-