Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

AEM-Email Workflow Task Notification

Avatar

Level 10

Hello,

I have managed to send an email via a workflow process step customized wherein the email is sent to his gmail account, but in addition to that would want a notification triggered to the user's inbox in AEM , but the moment he clicks on the link(link to a page) in his gmail account or his inbox, and navigates to the page,i would like to have the next step workflow displayed on the workflow tab and moment he says complete or approve i would want to erase the task from inbox.

Is there a way to

1) Trigger a task notification using java code to user's inbox in AEM, i don't see much references for the same, would appreciate if someone guides me through,

2) Once clicked on the link(link to a page in AEM,embedded in the email to his email account) or task notification in inbox, would want to have the next step displayed in workflow 

3)Would want to see an approve or reject in the workflow tab in sidekick.

Appreciate kind help.

Regards,

Nicole

1 Accepted Solution

Avatar

Correct answer by
Level 10

Generally speaking user choose notification based on his interest & event.  However you are forcing user to subscribe.   Mean to say I do not understand your usecase. However I am throwing hackaround which you can try

1)    AFAIK there is no api.  However as a workaround add workflow step to create a node with all the required properties under user home directory. Ex:- /home/users/a/admin/wcm/notification/inbox  Then it should appear in inbox.

2)     If the payload still in workflow it will show the next task.

View solution in original post

13 Replies

Avatar

Correct answer by
Level 10

Generally speaking user choose notification based on his interest & event.  However you are forcing user to subscribe.   Mean to say I do not understand your usecase. However I am throwing hackaround which you can try

1)    AFAIK there is no api.  However as a workaround add workflow step to create a node with all the required properties under user home directory. Ex:- /home/users/a/admin/wcm/notification/inbox  Then it should appear in inbox.

2)     If the payload still in workflow it will show the next task.

Avatar

Level 10

Sham HC wrote...

Generally speaking user choose notification based on his interest & event.  However you are forcing user to subscribe.   Mean to say I do not understand your usecase. However I am throwing hackaround which you can try

1)    AFAIK there is no api.  However as a workaround add workflow step to create a node with all the required properties under user home directory. Ex:- /home/users/a/admin/wcm/notification/inbox  Then it should appear in inbox.

2)     If the payload still in workflow it will show the next task.

 

Hello Sham, 

Thanks for all the information. The use case is, once translation is complete i have written a workflow which gets triggered based on the payload , and now identifies the language for which the translation has been triggered, ie. eg: en_US,. Now once the language code is identified, i extract the group i have to send an email to, based on language code eg: "en_US-approvers " , i would send an email to the users in the list, this being Step1(Custom Send Email Workflow). Now this email is to their personal email ID's.

 I would like to have a notification to their inbox in AEM, for this i have the following questions in mind

1)  how do i send the notification to users in the group, "en_US-approvers ", once obtained in step1. If i add a participant step, can i programmatically pass data (group name- "en_US-approvers" )from step 1 into step2,which is participant step as shown in the snapshot and have the User/Group field populated? Or should i have another workflow step customized? If customized how do i pass the data eg: payload from one process step to another? 

2) If you say that the notification has to be based on user's choice, whats the best way you would suggest for such implementation?

3) After triggering notification in step2, to users inbox, I have an approve and Reject Flow. I have attached the sample workflow, but i have the group hard coded in step2, participant step. 

Please let me know your thoughts on this.

Avatar

Former Community Member

Sham,

This problem seems related to Inbox notification API. It is not made public because of that we cannot use it for creating notifications from API. Is there any possibility of Adobe making it public?

NitroHazeDev,

This is of the thread where we were discussing regarding inbox notification http://forums.adobe.com/thread/1156802

-Maruthi

Avatar

Level 10

You can pass data between workflow step using workflow Data put & get like workflowData.getMetaDataMap().put("group", group); more details refer http://forums.adobe.com/thread/1156064
 
 Subscription is oob option. Take a look at http://wem.help.adobe.com/enterprise/en_US/10-0/wem/wcm/working_with_cq_wcm.html#Notification%20Inbo...

Avatar

Level 10

The user's inbox is not meant to be programmatically accessible. CQ does not provide a public API for accessing to inboxes. That is the reason I have provided workaround.

Avatar

Level 10

Thank you Scott and Sham, managed to get  working,

Is it possible for me to have an email sent to User's inbox in AEM just the way "Dynamic Participant " step does, As sham mentioned regarding workaround for inbox, "AFAIK there is no api.  However as a workaround add workflow step to create a node with all the required properties under user home directory. Ex:- /home/users/a/admin/wcm/notification/inbox  Then it should appear in inbox."

I would like to know what are the nodes i need to create,under the user's home directory and what are the primarytype or resourceTypes, is there any node existing in AEM that i could mock up using code to send notification to user's inbox?

I see the following message now that i am in step 2 of the custom workflow step in sidekick, "Custom Email Workflow". Is there something that i need to add in my custom participant step code to move it to next step just the way we have the handler advance?

In addition to that i would like to have the next workflow step say (Approve) to be seen by only users belonging to the group i have sent notification to inbox?

Regards,

Nicole

Avatar

Level 10

Alternatively if there is any easier way to have the dynamic participant step pick up group name rather than manually modifying it, would be glad to hear.

Please let me know

Avatar

Level 10

Thanks Sham, managed to sort out majority of issues with workflow.

I have the below notification email being sent across on node transition, is it possible to alter the hostname and port in the node transition notification email being sent across?

-------------------------------------------------------------------------------------
 Time: Wed Oct 02 14:11:32 EDT 2013
 Step: Review
 User: XXXX  (XXX)
 Workflow: Email Workflow
 -------------------------------------------------------------------------------------

Page: http://localhost:4502/content/campaigns/geometrixx/scott-recommends.html

 -------------------------------------------------------------------------------------
 View the overview in your http://localhost:4502/inbox
 -------------------------------------------------------------------------------------
 This is an automatically generated message. Please do not reply.

Avatar

Level 10

Fixed it , will update with progress .

Avatar

Level 10

As per snapshot attached ,would like to step back from Reject to Review Content Participant step, Is it possible?  If not, is it possible to have the reject step do nothing and still have the task in user's inbox in AEM instance, more like "Cancel"(do nothing, and retain task in AEM instance inbox)

Is it possible at participant step to programmatically disable task notifications/node transition email to user's private mail box still retaining task notification in AEM inbox?

Please let me know. Suggestions are welcome.

Regards,