Forum Discussion
wilderichsophus if this is possible to call api from your context, you could easily get user first_name and last_name.
<#assign apiVersion = "2.0"/> <#assign user_id = 'user-id'> <#assign userQuery = "select first_name,last_name from users where id = '${user_id}' "/> <#assign usersData = rest(apiVersion, "/search?q=" + userQuery?url).data.items[0]/> ${usersData.first_name} ${usersData.last_name}
Give Kudo if you find my post helpful.
- irach15Maven
was you able to run your code in email template?
Just looking at the reply bellow about not possible to use API calls in email templates.
Alos, I believe first name and last name can be only vissible at Admin level...
Let us know.
Thank you.
- Hi tariq,
I apologise for the late reply.
I have been turning your recommended snippet upside down. I am afraid the HTML email template that sits inside Studio -> Text Editor -> Email Text does not execute API call.
I am still researching for answer.
Thank you.
Welcome to the Lithium Community. I'm sure you'll find this a very useful place.
I'm not sure if you can achieve what you want to do, but I would guess that the vast majority of communities would use $user.login (username) as that's what community members are generally going to be referred to on the community - that's their chosen "name".
Also, have you made completing the first name field when registering mandatory for community members? If not then obviously using the first name might not be a great idea for the notification.
Jason
- Hi Jason,
Yes, I can pull in username using $user.login, though I was thinking for a bit more personalised greetings using first name - "Hi, John!"
Yes, I have also made the first name field mandatory for this purpose.
Thank you for the input, Jason.
Regards,
Johan
Related Content
- 5 years ago
- 5 years ago