Email Notifier

Payara Server is able to direct notifications from the Notification service to a single given email address.

Requirements

  • A valid, configured JavaMail session.

Configuration

At a high level, the steps to configure the email notifier are:

  1. Create a JavaMail Session

  2. Create the notifier using the asadmin command or through the Admin Console

Email Notifier Configuration

You will need a JavaMail session to send the notifications; instructions on setting up a JavaMail session can be found in the core documentation.

The email notifier is configured in the Email tab of the Notification Section of the server’s instance configuration.

On the Email tab there are four fields:

Enabled

Determines whether the notifier should be activated.

Dynamic

Sets whether the notifier will be enabled without a restart, true enables it immediately, while false 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 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 asadmin command.

Email Notifier on Admin Console

The same configuration can be set using an asadmin command, as shown below:

asadmin set-email-notifier-configuration --jndiName=mail/exampleEmailNotifier --recipient=notifications@example.com --enabled=true --dynamic=true

To check the currently applied configuration, you can run the following asadmin 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  JNDI Name                  Recipient
true     mail/exampleEmailNotifier  example@example.com