acs-aem-samples icon indicating copy to clipboard operation
acs-aem-samples copied to clipboard

AEM Inbox Notification

Open davidjgonzalez opened this issue 10 years ago • 1 comments

Sample code using TaskManager and Tasks

@sachinmali has example codes

davidjgonzalez avatar Apr 22 '15 20:04 davidjgonzalez

Here is pseudo code

  1. In your OSGi Service class, inject instance of 'InboxNotificationSender'(com.adobe.acs.commons.notifications.InboxNotificationSender)

  2. Invoke 'buildInboxNotification()' method on above injected class to get 'InboxNotification' instance InboxNotification inboxNotification = inboxNotificationSender.buildInboxNotification()

  3. Populate the 'InboxNotification' instance with your details inboxNotification.setTitle("Hello World"); inboxNotification.setContentPath("/my/sample/path"); inboxNotification.setAssignee("AEM-USER-PRINCIPAL-NAME"); inboxNotification.setMessage("Greetings of the day!"); inboxNotification.setNotificationActions("Approve");

  4. Invoke 'sendInboxNotification()' method on Step-1 injected object, like

     inboxNotificationSender.sendInboxNotification(resourceResolver,inboxNotification);
    

SachinMali avatar Sep 18 '17 13:09 SachinMali