I have created a content approver workflow in liferay 6.2. I want to show user name and other variables values which are used in template tag in email subject.
I have added description tag to show email subject but when i try to use variable in this it show variable as string instead of its value.
Below is my template
<actions>
<notification>
<name>Review Notification</name>
<description><![CDATA[${userName}]]> test sent you a <![CDATA[${entryType}]]> for review in the workflow.</description>
<template>${userName} sent you a ${entryType} for review in the workflow.</template>
<template-language>freemarker</template-language>
<notification-type>email</notification-type>
<notification-type>user-notification</notification-type>
<execution-type>onAssignment</execution-type>
</notification>
<notification>
<name>Review Completion Notification</name>
<description>Your submission has been reviewed and the reviewer has applied the following ${taskComments}.</description>
<template>Your submission has been reviewed and the reviewer has applied the following ${taskComments}.</template>
<template-language>freemarker</template-language>
<notification-type>email</notification-type>
<recipients>
<user/>
</recipients>
<execution-type>onExit</execution-type>
</notification>
</actions>
In description tag i have used variable ${username} and ${entryType} but instead showing
"Test sent you a Web Content Article for review in the workflow."
it is showing : "${userName} sent you a ${entryType} for review in the workflow."
But in email body it is displaying fine. Any Help
Unfortunately, you are not able to pass any variables into this section, assuming you are not making any modification to original Liferay source.
String notificationMessage = notificationMessageGenerator.generateMessage(kaleoNotification.getKaleoClassName(), kaleoNotification.getKaleoClassPK(), kaleoNotification.getName(), kaleoNotification.getTemplateLanguage(), kaleoNotification.getTemplate(), executionContext);
String notificationSubject = kaleoNotification.getDescription();
These lines above are responsible for message creation. As you can see notificationMessage is created using executionContext and some other parameters, which are storing context variables and in the end replacing your token variables with real values. Description is just simple String passed forward, so there is no such replacement done in this case.