Expand my Community achievements bar.

SOLVED

AEM 5: How can i get an email address from userid in cq 5.5

Avatar

Employee

How can i get email address from the userid/Authorizable as in CQ 5.5 Profile class is Deprecated

 

Environment CQ 5.5, Linux

1 Accepted Solution

Avatar

Correct answer by
Employee

use com.adobe.granite.security.user.UserProperties instead. e.g.

 

UserProperties u = resourceResolver.adaptTo(UserProperties.class);

String email = u.getProperty(UserProperties.EMAIL);

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

use com.adobe.granite.security.user.UserProperties instead. e.g.

 

UserProperties u = resourceResolver.adaptTo(UserProperties.class);

String email = u.getProperty(UserProperties.EMAIL);