To create notifications on the server side, simply inject the NotificationService
and use it at the appropriate position (event/request handler, REST method, task etc.) to create a
new notification with the method createNotification
:
Notification createNotification(@Nonnull String type, @Nonnull Object recipient, @Nonnull String key, @Nullable List<Object> parameters);
A notification always has a combination of type
and key
. The key is basically a
sub-type and will be used to determine the correct localization text key on the client
side. An example of a type / key combination is "publicationWorkflow" / "offered".
A notification has a recipient
. This parameter is typed as Object
. For
Studio notifications, it has to be a User
object.
Additional parameters
will be used on the client side to parametrize the
notification's text. In advanced cases they are additionally used to configure actions
and customize the notification's UI. Details are explained below.