cancel
Showing results for 
Search instead for 
Did you mean: 

How to get email address of site members?

mcasanket
Champ on-the-rise
Champ on-the-rise
Hello Everyone,  Smiley Very Happy
  
   After calling a method site.listMembers(null, null, 0) I am getting a map. I want to fetch the username or email address from the map. How can I do it. Please help me.

thanking you!
3 REPLIES 3

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
Once you have the list of the members you can get to their properties using the People Service http://wiki.alfresco.com/wiki/3.4_JavaScript_API#People_API


var user = people.getPerson(username);

var email = user.properties["cm:email"];

Regards,
Adei

mcasanket
Champ on-the-rise
Champ on-the-rise
Hi  Adei,  Smiley Very Happy
   Thanks for your reply. My problem is, how can I get the username. I meant after calling the site.listMembers(); it is returning a map.
 
  var siteMembers = site.listMembers(null,null,0); 
  How can I fetch the username from the siteMembers variable?


var user = people.getPerson(username);
var email = user.properties["cm:email"];

Thanking you!

mcasanket
Champ on-the-rise
Champ on-the-rise
Thanks Adei!
   It helped me a lot! I got my problem solved!


var user = people.getPerson(username);
var email = user.properties["cm:email"];

Thank you once again!  Smiley Very Happy