Email Notifier
Payara Server is able to direct notifications from the Notification service to a single given email address.
Configuration
At a high level, the steps to configure the email notifier are:
-
Create a JavaMail Session
-
Create the notifier using the Asadmin CLI or through the Admin Console
Email Notifier Configuration
You will need a JavaMail session to send notifications; instructions on setting up a JavaMail
session can be found in the core documentation of the JavaMail API.
Using the Admin Console
The email notifier is configured in the Email tab of the Notification Section of the server’s instance configuration in the Admin console. There are four fields available for configuration:
Enabled
-
Determines whether the notifier should be enabled.
Dynamic
-
Sets whether the notifier will be enabled without a restart,
true
enables it immediately, whilefalse
requires a restart. JavaMail JNDI Name
-
Sets the name of the Java Naming and Directory Interface (JNDI) of the configured
JavaMail
session. The parameter name is--jndiName
in the corresponding asadmin command. Target Address
-
Sets the email address which will receive the email notifications. Currently only one address can be specified. The parameter name is
--recipient
in the corresponding asadmin command.
Using the Asadmin CLI
The following command will set up the email notifier configuration:
asadmin set-email-notifier-configuration --jndiName=mail/exampleEmailNotifier --recipient=notifications@example.com --enabled=true --dynamic=true
And if you want to check the currently applied configuration, run the following command:
asadmin get-email-notifier-configuration
It will return the current configuration of the email notifier in full detail; including whether it is enabled, the recipient address, and the JNDI name of the current JavaMail session in use.
Here is an example output:
$ asadmin get-email-notifier-configuration
Enabled Filter JNDI Name Recipient
true WARNING mail/exampleEmailNotifier example@example.com