Get user email in Concrete5 8.4.4

Permalink
In Concrete5 8.4.4 version, I would like to receive user's email.

From the documentation, that's done with the following:

$User = new User();
$UserEmail = $User->getUserEmail();


The following error message however is received:
Call to undefined method Concrete\Core\User\User::getUserEmail()

The user name received from $User->getUserName(); does work.

How to receieve user's email?

Janks
 
mnakalay replied on at Permalink Best Answer Reply
mnakalay
Hello. Do it like this:
$user = new User();
$userInfo = $user->getUserInfoObject();
$userEmail = $userInfo->getUserEmail();
Janks replied on at Permalink Reply
Janks
Thanks for the valuable tip on how to receive users' email address from that user info object.

That represents the perfect solution.

The user info object usage is now tested in our test environment, and can now be released then in our production web site.