Method to get userkey based on username ( Users class ) - Email Template

New Contributor
New Contributor


When we use the below:


We are able to send the email, where 235507 is the USERKEY

Is there a way to fetch the userKey when we only know the Username ?

Can we use any method any method under the Users class which gives us the userkey based on the username which can be used in the statement provided below to send an email ?




Hi Rushikesh,

Thank you for responding.

I actually wanted to know on how do we get the USERKEY based on only the username.

Is there any method which we can call on the Users class to get that info ?

In the response above, we are getting the username based on the userkey, but the ask here is the opposite.

Please let us know about this. Thanks.


Can you print all variables available in email template using below code

${this.binding.variables.each {k,v -> println "$k = $v" + "<" + "br" + ">"}})