Expand my Community achievements bar.

SOLVED

How to send AEM Inbox Notification from Custom Workflow Process?

Avatar

Level 1

Hi All,

 

We have a requirement to send AEM Inbox notifications in custom AEM workflow process step. In this custom workflow process, we are reading a file and creating pages by reading the data of that file.  We need to send different Inbox notification messages based on different conditions. So, I am looking for any OOB Notification API which we can integrate in custom workflow process step to send notification messages.

 

@arunpatidar @Sady_Rifat @Saravanan_Dharmaraj @lukasz_m @Vijay_Katoch 

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
2 Replies

Avatar

Correct answer by
Community Advisor

Avatar

Employee Advisor

Hi,

 

You can use the AEM Notifications API to send inbox notifications in a custom AEM workflow process step. To use this API, you will need to create a notification message and specify the user or group who should receive the notification. The message can be customized based on different conditions in your workflow process.

Here's an example code snippet for sending a notification:

// Get the notification service
NotificationsService notificationsService = sling.getService(NotificationsService.class);

// Create a notification message
Notification notification = notificationsService.createNotification("Workflow Notification Title", "Workflow Notification Message", NotificationSeverity.MINOR);

// Set the user who should receive the notification
notification.setRecipient(user);

// Send the notification
notificationsService.sendNotification(notification);