cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

for copyright year in footer of email template i am using this © ${ctx.messages.getMessage(${ctx.dateTool.getYear()})} but it is printing same code on the template. can anybody suggest on this?

Former Member

Accepted Solutions (0)

Answers (1)

Answers (1)

arvind-kumar_avinash
Active Contributor
0 Likes

Instead of ${ctx.messages.getMessage(${ctx.dateTool.getYear()})}, just try one of the following:

 $ctx.dateTool.getYear()

or

 ${ctx.dateTool.getYear()}

or

 $ctx.dateTool.get('yyyy')

or

 $ctx.dateTool.format('yyyy', $ctx.dateTool)

As per the DateTool documentation, the default key is date [@DefaultKey(value="date")] and therefore, you can even try

 $date.get('yyyy')
Former Member
0 Likes

even these are also not working.

arvind-kumar_avinash
Active Contributor
0 Likes

Hi - did you try any of the options in my updated answer?

Former Member
0 Likes

yes i tried with this line $ctx.dateTool.getYear() it is working fine in one vm file but while adding in the footer.vm where the code is in tag then it is not working . Do you know about this thing Or may be i have defined in some tags ... Even i tried with this way also #set ( $year = $ctx.dateTool.getYear()) and $year defined in that particular place this type also working in messgaebody.vm but not working in footer.vm

arvind-kumar_avinash
Active Contributor
0 Likes

Hi - Did any solution work for you? If the working solution is different from what I have provided, I request you to share the working solution so that it can help others.