Notifications with Liferay Objects

Trigger an email notification on various events of object entry.

Low code and no code development are handy for developing a website without a technical background. Liferay came with the Object concept, which is able to generate the persistence and service layers by just defining the required fields from the liferay control panel. In this blog, here are some essential points from the objects.

 

  1. Notification for an object entry

  2. Mappings between objects (Will release the blog soon)

  3. Different Actions on Object (Will release the blog soon)

 

Notification for ant object entry:

 

Liferay has the ability to send an email notification to a particular user(s) when someone adds entries to the object. For that, you just need to define the notification templates and do some configurations on the object.

 

Add Notification Template:

  • Define your object and publish it.

  • Navigate to the Control panel > NOTIFICATIONS > Templates.

  • Click on Add Template.

  • Give name, description, and email details.

  • Give the subject name and define the message in the body.

  • Now select the entity (Object) for which you need to send an email, so it will show the fields available in the object. You can copy the value of any object field into the email body.

  • Save it, complete section will look something like this.

 

Configure Notification in Object:

  • Open the object in edit mode.

  • Navigate to the Actions.

  • Click on the Add Action button.

  • From the Action builder, choose the event (On After Add, On After Delete, On After Update).

  • Select the Notification from the Action.

  • Save it. The complete setup will look something like this.

 

Great!! The setup is done, now when users will add entries into an object, Liferay will trigger emails on configured email address.

Note: 

  1. Liferay uses a Scheduler job to trigger the notification, you may need to wait for the next scheduler cycle.
  2. You can take a look at the pending notification from the Control panel > NOTIFICATIONS > Queue.
Blogs