function User::getEmail
Returns the email address of this account.
Return value
string|null The email address, or NULL if the account is anonymous or the user does not have an email address.
Overrides AccountInterface::getEmail
File
-
core/
modules/ user/ src/ Entity/ User.php, line 253
Class
- User
- Defines the user entity class.
Namespace
Drupal\user\EntityCode
public function getEmail() {
return $this->get('mail')->value;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.