@Singleton public class EmailFactory extends Object
Email instances by applying the settings from
EmailConfiguration.| Constructor and Description |
|---|
EmailFactory(EmailConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
<T extends org.apache.commons.mail.Email> |
getPreconfigured(Supplier<T> objectSupplier)
Creates a preconfigured
Email object with the settings from EmailConfiguration applied. |
org.apache.commons.mail.HtmlEmail |
htmlEmail()
Creates a preconfigured
HtmlEmail object with the settings from EmailConfiguration applied. |
org.apache.commons.mail.ImageHtmlEmail |
imageHtmlEmail()
Creates a preconfigured
ImageHtmlEmail object with the settings from EmailConfiguration applied. |
boolean |
isEmailTransportEnabled() |
org.apache.commons.mail.MultiPartEmail |
multiPartEmail()
Creates a preconfigured
MultiPartEmail object with the settings from EmailConfiguration applied. |
org.apache.commons.mail.SimpleEmail |
simpleEmail()
Creates a preconfigured
SimpleEmail object with the settings from EmailConfiguration applied. |
@Inject public EmailFactory(EmailConfiguration configuration)
public boolean isEmailTransportEnabled()
public org.apache.commons.mail.SimpleEmail simpleEmail()
throws org.apache.commons.mail.EmailException
SimpleEmail object with the settings from EmailConfiguration applied.org.apache.commons.mail.EmailException - If applying configuration values fails.public org.apache.commons.mail.MultiPartEmail multiPartEmail()
throws org.apache.commons.mail.EmailException
MultiPartEmail object with the settings from EmailConfiguration applied.org.apache.commons.mail.EmailException - If applying configuration values fails.public org.apache.commons.mail.HtmlEmail htmlEmail()
throws org.apache.commons.mail.EmailException
HtmlEmail object with the settings from EmailConfiguration applied.org.apache.commons.mail.EmailException - If applying configuration values fails.public org.apache.commons.mail.ImageHtmlEmail imageHtmlEmail()
throws org.apache.commons.mail.EmailException
ImageHtmlEmail object with the settings from EmailConfiguration applied.org.apache.commons.mail.EmailException - If applying configuration values fails.public <T extends org.apache.commons.mail.Email> T getPreconfigured(Supplier<T> objectSupplier) throws org.apache.commons.mail.EmailException
Email object with the settings from EmailConfiguration applied.objectSupplier - Supplier to create a raw object of the appropriate subtype of Emailorg.apache.commons.mail.EmailException - If applying configuration values fails.Copyright © 2012–2022 Graylog, Inc.. All rights reserved.