You are here

function user_load_by_mail in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/user.module \user_load_by_mail()

Fetches a user object by email address.

Parameters

string $mail: String with the account's email address.

Return value

object|bool A fully-loaded $user object upon successful user load or FALSE if user cannot be loaded.

See also

\Drupal\user\Entity\User::loadMultiple()

1 call to user_load_by_mail()
_update_cron_notify in core/modules/update/update.fetch.inc
Performs any notifications that should be done once cron fetches new data.

File

core/modules/user/user.module, line 233
Enables the user registration and login system.

Code

function user_load_by_mail($mail) {
  $users = entity_load_multiple_by_properties('user', array(
    'mail' => $mail,
  ));
  return $users ? reset($users) : FALSE;
}