public class Mails extends Object implements sirius.kernel.health.metrics.MetricProvider
Modifier and Type | Field and Description |
---|---|
static sirius.kernel.health.Log |
LOG
Contains the logger mail used by the mailing framework.
|
static String |
X_BOUNCETOKEN
Defines a header which can be used to add a bounce token to an email.
|
Constructor and Description |
---|
Mails() |
Modifier and Type | Method and Description |
---|---|
MailSender |
createEmail()
Creates a new builder which is used to specify the mail to send.
|
void |
failForInvalidEmail(String address,
String name)
Determines if the given email address and the optional name is valid.
|
void |
gather(sirius.kernel.health.metrics.MetricsCollector collector) |
boolean |
isValidMailAddress(String address,
String name)
Determines if the given address is a valid eMail address.
|
public static final sirius.kernel.health.Log LOG
public static final String X_BOUNCETOKEN
This token can be extracted from received bounce mails and handled properly.
public void gather(sirius.kernel.health.metrics.MetricsCollector collector)
gather
in interface sirius.kernel.health.metrics.MetricProvider
public MailSender createEmail()
public boolean isValidMailAddress(@Nullable String address, @Nullable String name)
The name is optional and can be left empty. If address is null or empty, false will be returned.
address
- the email address to checkname
- the optional name to also checkpublic void failForInvalidEmail(@Nullable String address, @Nullable String name)
address
- the email address to validatename
- the optional name to validate - can be left empty or nullCopyright © 2018. All rights reserved.