cancel
Showing results for 
Search instead for 
Did you mean: 

FreeMarker question [Solved]

michaelc
Champ on-the-rise
Champ on-the-rise
I am doing some basic testing - trying to understand.

I added the following to the invite email script
<#list args?keys as arg>
  ${arg}=${args[arg]}
</#list>

because I wanted to see all the parameters - seems logical
but this throws an error
Expression args[arg] is undefined on line 18 column 12
so what did I not understand ?\
complete FTL
<#assign inviterPersonRef=args["inviterPersonRef"]/>
<#assign inviterPerson=companyhome.nodeByReference[inviterPersonRef]/>
<#assign inviteePersonRef=args["inviteePersonRef"]/>
<#assign inviteePerson=companyhome.nodeByReference[inviteePersonRef]/>

Hello ${inviteePerson.properties["cm:firstName"]},

You have been invited by ${inviterPerson.properties["cm:firstName"]} ${inviterPerson.properties["cm:lastName"]} to join the CESR '${args["siteName"]}' site.

Your role in the site will be ${args["inviteeSiteRole"]}.

To accept this invitation click the link below.
${args["acceptLink"]}

Regards,
  CESR Website Team
<#list args?keys as arg>
  ${arg}=${args[arg]}
</#list>
2 REPLIES 2

mikeh
Star Contributor
Star Contributor
Try checking for null or missing values, i.e. something like

${args[arg]!""}

michaelc
Champ on-the-rise
Champ on-the-rise
Try checking for null or missing values, i.e. something like

${args[arg]!""}

Ahh ok makes sence