AEM 6.2 Classic : Capture comments in default email template used by workflow | Community
Skip to main content
cquser1
Level 7
Aug 31, 2018 4:59 AM UTC
Solved

AEM 6.2 Classic : Capture comments in default email template used by workflow

Hi All,

The use case for us is same as mentioned in Capturing comments in default email template used by workflow in 6.2 .

Tried the solution mentioned in the above forum post, but no luck.

All the participant steps in our case is "Dynamic Participant Step". Tried multiple things in "/etc/workflow/notification/email/default/en.txt/", based on Configuring Email Notification  but no luck.

Any thoughts/pointers/reference code on this will be really helpful.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Aug 31, 2018 9:05 AM UTC

Hi,

Did you try below,  mentioned at Configuring Email Notification

Comment: ${item.data.comment}\n \

Arun Patidar

18 replies

cquser1
cquser1Author
Level 7
Aug 31, 2018 6:05 PM UTC

Hi All,

We are trying to implement a custom process step wherein it will send almost similar details sent by OOTB template [/etc/workflow/notification/email/default] along with the comment provided by the previous participant step.

Able to make some progress here. For example : Once step1 is completed, mail should be triggered to user2 in step2. Able to capture comments/task end date etc of step 1. Am not able to find any property in the workflow, wherein I get user2 details(who is part of  step2), to whom the mail should be sent.

Any thoughts/pointers on this will be really helpful.

Translate
cquser1
cquser1Author
Level 7
Aug 31, 2018 1:28 PM UTC

Hi Endoriel,

Thank you for your reply.

Tried getting the comments by adding a new variable[with various options i.e, ${item.node.data.comment}\n \, ${item.data.comment}\n \  etc] in the existing OOTB template in the path /etc/workflow/notification/email/default as mentioned in Configuring Email Notification  .

Not sure if I am missing something here. Tried multiple times with various options.

The other variables in the OOTB template gets populated correctly in the mail received.

Below is the OOTB content[/etc/workflow/notification/email/default]

---------------------------------------------------------------------------------------------------------------------------------------------------------------------

subject=Workflow notification: ${event.EventType}

header=-------------------------------------------------------------------------------------\n \

Time: ${event.TimeStamp}\n \

Step: ${item.node.title}\n \

User: ${participant.name} (${participant.id})\n \

Workflow: ${model.title}\n \

-------------------------------------------------------------------------------------\n\n

message=Content: ${host.prefix}${payload.path.open}\n

footer=\n \

-------------------------------------------------------------------------------------\n \

View the overview in your ${host.prefix}/inbox\n \

-------------------------------------------------------------------------------------\n \

This is an automatically generated message. Please do not reply.

Translate
smacdonald2008
Level 10
Aug 31, 2018 1:20 PM UTC

In that other thread - the user said the solution was  --

Use the variable ${item.data.comment} in the default en.txt

Translate
Endoriel
Level 2
Aug 31, 2018 12:50 PM UTC

It should work with ${item.data.comment} since from code doing workflow.getWorkItems().get(0).getMetaDataMap().get("comment") would return the comment and in the template context "item.data" is just workItem.getMetaDataMap() so I'm not sure. I will test it later. Are you sure you are editing the correct template? Can you add successfully some of the other available variables?

If you can't get it to work I would suggest implementing your own custom version of the EMailNotificationService which is just an osgi event handler for "com/day/cq/workflow/event"

Translate
cquser1
cquser1Author
Level 7
Aug 31, 2018 11:57 AM UTC

Hi Endoriel,

Tried using the below.

TEST: ${item.node.data.comment}\n \

But no luck.

Any thoughts here would be helpful.

Translate
Endoriel
Level 2
Aug 31, 2018 11:15 AM UTC

Hi,

Can you try ${item.node.data.comment} ?

If not, I can try to suggest some other options.

Translate
cquser1
cquser1Author
Level 7
Aug 31, 2018 9:22 AM UTC

Hi Arun,

Yes, I did try that in the OOTB /etc/workflow/notification/email/default/en.txt file. But that doesn't work.

Translate
arunpatidar
arunpatidarAccepted solution
New Participant
Aug 31, 2018 9:05 AM UTC

Hi,

Did you try below,  mentioned at Configuring Email Notification

Comment: ${item.data.comment}\n \

Translate
Arun Patidar