Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Workflow email template, comment display

Greg_Pai
Level 1
Level 1

Hello,

 

I having an issue with the var "${item.data.comment}" in a mail template. 

Based on this documentation : https://experienceleague.adobe.com/docs/experience-manager-64/administering/operations/notification....

I have customized the template used for the mail sent for each workflow participant step where the "email" box is checked.

 

The header is now :

header=-------------------------------------------------------------------------------------\n \
Time: ${event.TimeStamp}\n \
Step: ${item.node.title}\n \
User: ${participant.name} (${participant.id})\n \
Workflow: ${model.title}\n \
Comment: ${item.data.comment}\n \

The comment line is working for each step but the first one. 

For the first step, I receive this mail : 

-------------------------------------------------------------------------------------
 Time: Wed Oct 27 10:52:13 CEST 2021
 Step: Demande de validation DCP
 User: Polo Administrator (admin)
 Workflow: CNP - DCP Validation
 Comment: ${item.data.comment}
 -------------------------------------------------------------------------------------

 

Then, for an other step : 

-------------------------------------------------------------------------------------
 Time: Wed Oct 27 11:05:39 CEST 2021
 Step: Demande de validation DCP
 User: Polo Administrator (admin)
 Workflow: CNP - DCP Validation
 Comment: Commentaire pour dire KO
 -------------------------------------------------------------------------------------

 

Is there anyway to prevent the mail template to display a var that is not initialized ? 

 

Many thanks,

Grégory 

1 Accepted Solution
SivaPrasadReddyS
Correct answer by
Level 7
Level 7
2 Replies
SivaPrasadReddyS
Correct answer by
Level 7
Level 7
Arun_Patidar
Community Advisor
Community Advisor

Hi,

Not sure but try adding if helps

Comment: ${item.data.comment ?item.data.comment : ''}

I did not tried this, this is just an assumption, it may not work because workflow template is not htl. But you can try.