Index: src/main/java/com/xpn/xwiki/api/XWiki.java =================================================================== --- src/main/java/com/xpn/xwiki/api/XWiki.java (revision 7394) +++ src/main/java/com/xpn/xwiki/api/XWiki.java (working copy) @@ -2870,4 +2870,19 @@ long c = Long.parseLong(a) + Long.parseLong(b); return "" + c; } + + /** + * API to retrieve the e-mail address of the specified user. This e-mail address is taken from + * the user profile. If the user hasn't changed his profile, then this is the e-mail address he + * filled in the registration form. + * + * @param user Fully qualified username as retrieved from $context.user (XWiki.LudovicDubost) + * @return The e-mail address from the user profile + */ + public String getUserEmail(String user) + { + Document userdoc = getDocument(user); + userdoc.use("XWiki.XWikiUsers"); + return (String) userdoc.getValue("email"); + } }