Expand my Community achievements bar.

SOLVED

How to capture CQ workflow comment on email notification

Avatar

Level 2

Hi Experts,

I am looking for help on how to capture CQ workflow comment which is located on workitem on default email notification. 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

You can write a custom workflow step which will get the comments as in the code sample given in the forum thread I shared earlier. And then save the read comment on the payload as custom property. In the workflow model just include this step before any participant step in which you want to send email notifications. And then in the template you can read the comment by just fetching it by the name of custom property. Ex - ${payload.previousComment}

OR Instead of using default workflow notification you can create a custom workflow step of sending emails. For email code you can reuse the Adobe ACS email service - http://adobe-consulting-services.github.io/acs-aem-commons/features/email-api.html

View solution in original post

3 Replies

Avatar

Employee Advisor

You will have to write custom code to read comments. Check this link - https://forums.adobe.com/thread/1156064

Avatar

Level 2

Hi Kunal23,

Many thanks for your reply...I went thru on the link you sent...
It is seems Javascript and Java code, but since the email template /etc/workflow/notification/email/default/en.txt comes from this path. 

So, is it still possible to captured the comment on this .../../.../en.txt file..

Avatar

Correct answer by
Employee Advisor

You can write a custom workflow step which will get the comments as in the code sample given in the forum thread I shared earlier. And then save the read comment on the payload as custom property. In the workflow model just include this step before any participant step in which you want to send email notifications. And then in the template you can read the comment by just fetching it by the name of custom property. Ex - ${payload.previousComment}

OR Instead of using default workflow notification you can create a custom workflow step of sending emails. For email code you can reuse the Adobe ACS email service - http://adobe-consulting-services.github.io/acs-aem-commons/features/email-api.html