cancel
Showing results for 
Search instead for 
Did you mean: 

Get Person Email Address and Send Mail

nyronian
Champ in-the-making
Champ in-the-making
I would like to get the logged-in-users email address from Alfresco in Java Code (A new Dialog I am creating) and I cannot find where the information is stored.  Can anyone point me in the right direction?

The below code gives me the username and the user node but I can't find the email.
String userName = serviceRegistry.getAuthenticationService().getCurrentUserName();
NodeRef user = serviceRegistry.getPersonService().getPerson(userName);
3 REPLIES 3

nyronian
Champ in-the-making
Champ in-the-making
If anybody is ever interested….the following line gets the persons email (added to the script above)
String address = (String)nodeService.getProperty(user, ContentModel.PROP_EMAIL);

louise
Champ in-the-making
Champ in-the-making
How did you get the list of logged-in users?

ivo_costa
Champ in-the-making
Champ in-the-making
serviceRegistry.getAuthenticationService().getCurrentUserName();

I think this only gets you the current logged-in user. Because this is client side you only get one user.