cancel
Showing results for 
Search instead for 
Did you mean: 

Error when using Fn functions in mail template (5.6)

ganie_
Champ on-the-rise
Champ on-the-rise

Hi,

Within studio I created a workflow with a mail template associated to the task assignment. I would like to put user informations in the template using the Fn functions, but it does not work :

...
org.nuxeo.ecm.core.api.ClientException: Failed to send notification email
...
Caused by: freemarker.core.InvalidReferenceException: Expression Fn is undefined on line 1, column 157 in template_notificationTache.
	at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
	at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
...

I have this in the mail template :

${Fn.getPrincipal(WorkflowVariables["precedentActeur"]).getLastName()}

The studio documentation says it is possible to use ${Fn} functions in mail template context. Why is it not working in my case ? 😞

Thank you

1 REPLY 1

Mariana_Cedica
Star Contributor
Star Contributor

Hello,

Actually you can't use "Fn" in your context. If you look at the help documentation in Studio for the mail template the are tow different sections:

  1. one for variables available in the context of using the "SendEmail" operation and
  2. one for variables avaliable in the context of configuring a notification to be sent when a task is assigned during a workflow