Confluence User Macro get email address

416 Views Asked by At

Hi I'm trying to get the email address of a user with a supplied username parameter. I've been looking on here: https://docs.atlassian.com/atlassian-confluence/6.6.0/

But I haven't been able to find what I'm after.

I'm able to get the users name and profile pic, but I'm stuck on email, so if anyone could point me in the right direction that would be great!

I'm looking to do something like this, where I request the users email address based on the supplied username. But I can't find anything that matches up to that.

#set($email = $action.getEmail($paramUsername)) //one that I've tried but doesn't work!

--Full name and User pic if that helps anyone else!

> #set($displayName = $action.getUserFullName($paramUsername))
> #set($userPic = $userAccessor.getUserProfilePicture($userAccessor.getUserByName($paramUsername)).getUriReference())

Thanks!

1

There are 1 best solutions below

0
On BEST ANSWER

Someone on another forum kindly helped me out and I thought I'd post the answer here in case anyone else stumbles on this question!

$userAccessor.getUserByName('$paramUsername').getEmail()