Email notification template in RTC.
Hi,
I am using CLM 5.0.1.
I have created 2 different email templates, one email template for all work item state change except state In progress to completed and 2nd email template for state change In progress to completed.
Is there any possibility to send mail for state change notification using 2 different email template?
2 answers
No, only one template can be configured for work item change notification. Same is the case with other events, each event has one template associated.
The scenario you describe seems like you do need a notification on both cases but the content you wish to include is specific to the cases. You can customize the template to generate different content based on the conditions you have.
A simple if else clause could be used to get it. There are a set of variables you can use with Velocity syntax.
To get the work item state, use :
${workItem.state}
a simple if clause would look like this :
For more details, you can refer to this Reference section from CLM Help, here is a quick link for you :
#if($foo == $bar)it's true!#{else}it's not!#end
hope this helps
Hi Dinesh,
Actually I want to send mail for state change notification when 1. state change in progress to complete and 2. state change except state In progress to completed. As per above instruction I used "if else", but getting error.
I used below template :
<html> <body>
#if( ${workItem.state} == "Completed" ) #set($workItem.get("channelstatus")="Dropped")#end
A new form (CM):${workItem.title}(${workItem.identifier}) has been modified on ${workItem.created.fullDate} ${workItem.created.fullTime} India Standard Time. Please provide all necessary inputs.
<br>Requirement originator :${workItem.owner}</br>
<br>State of request : ${workItem.state}</br>
<br>Title of the request :${workItem.title}</br>
<br>Link to the request : <a href=>https://test.clm:9443/ccm/web/projects/Test%20Clm%20Business%20IT%20Requirement%20Management#action=com.ibm.team.workitem.viewWorkItem&id=${workItem.identifier}</a><br/>
<br>email ID:#if(${change.contributor.emailAddress}) ${change.contributor.emailAddress}#end </br>#end
#else( ${workItem.state} == "draft" )
A new channel master form (CM):${workItem.title}(${workItem.identifier}) has been created on ${workItem.created.fullDate} ${workItem.created.fullTime} India Standard Time. Please provide all necessary inputs.
<br>Requirement originator :${workItem.owner}</br>
<br>State of request : ${workItem.state}</br>
<br>Title of the request :${workItem.title}</br>
<br>Link to the request : <a href=>https://test.clm:9443/ccm/web/projects/Test%20Clm%20Business%20IT%20Requirement%20Management#action=com.ibm.team.workitem.viewWorkItem&id=${workItem.identifier}</a><br/>
<br>email ID:#if(${change.contributor.emailAddress}) ${change.contributor.emailAddress}#end </br>#end
</body></html>
Error:
Parse error
Encountered "#end\n" at line 8, column 103 of template
Was expecting one of:
<EOF>
"(" ...
<RPAREN> ...
<ESCAPE_DIRECTIVE> ...
<SET_DIRECTIVE> ...
"##" ...
"\\" ...
"\" ...
<TEXT> ...
"#" ...
"#" ...
<STRING_LITERAL> ...
<IF_DIRECTIVE> ...
<STOP_DIRECTIVE> ...
<INTEGER_LITERAL> ...
<FLOATING_POINT_LITERAL> ...
<WORD> ...
<BRACKETED_WORD> ...
<IDENTIFIER> ...
<DOT> ...
"{" ...
"}" ...
Was expecting one of:
<EOF>
"(" ...
<RPAREN> ...
<ESCAPE_DIRECTIVE> ...
<SET_DIRECTIVE> ...
"##" ...
"\\" ...
"\" ...
<TEXT> ...
"#" ...
"#" ...
<STRING_LITERAL> ...
<IF_DIRECTIVE> ...
<STOP_DIRECTIVE> ...
<INTEGER_LITERAL> ...
<FLOATING_POINT_LITERAL> ...
<WORD> ...
<BRACKETED_WORD> ...
<IDENTIFIER> ...
<DOT> ...
"{" ...
"}" ...