Load a user by e-mail

@param string $email  E-mail address
@param bool   $active (Optional) Require user be active, default true

@return array|bool Associative array for the user or false if not found
760287
public static function fromEmail($email, $active = true)
    {
        global $PPHP;
        $db = $PPHP['db'];

        $email = strtolower($email);
        $isActive = ($active ? ' AND active ' : '');
        if ($user = $db->selectSingleArray(self::$_selectFrom . " WHERE email=? {$isActive}", array($email))) {
            return $user;
        };
        return false;
    }
484482
static function fetchByEmail( $email )
    {
        $cond = array( 'email' => $email );
        $return = eZPersistentObject::fetchObject( self::definition(), null, $cond );
        return $return;
    }
608542
public function afterActivate($event, $email)
    {
        $Users = TableRegistry::get(Configure::read('CM.UserModel'));

        $user = $Users->findByEmail($email)->first()->toArray();

        $this->activationConfirmation($user);
    }
260258
private function getUser($email)
    {
        $user = $this->userRepository->findOneBy([
            'email' => $email,
        ]);

        if (empty($user)) {
            throw new FormException(sprintf('Unable to find user by email "%s".', $email));
        }

        return $user;
    }
377892
public static function isMail($email)
    {
        $parts = explode('@', $email);

        if (!is_string($email) || count($parts) != 2) {
            return false;
        }

        return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
    }
245169
public static function email($email)
    {
        $html = self::getInstance()->html;
        $args = func_get_args();
        return call_user_func_array(array($html, __FUNCTION__), $args);
    }
576048
public function thereIsAUserWithTheEmail($email)
    {
        $users = $this->getRepository()->getUserService()->loadUsersByEmail($email);

        Assertion::assertGreaterThan(0, count($users), "No user was found with the email '$email'");
        Assertion::assertInstanceOf('eZ\Publish\API\Repository\Values\User\User', $users[0]);
    }
1194030
public function activate($email, $requestKey)
    {
        if ($this->validateRequestKey($email, $requestKey)) {
            $user = $this->findByEmailAndRequestKey($email, $requestKey)->first();
            if ($user->active == 0) {
                $user->active = 1;
                $user->request_key = null;
                if ($this->save($user)) {
                    return true;
                }
            }
        }
        return false;
    }
596895
public function validateEmail($email)
    {
        if (empty($email)) {
            return false;
        }

        $validationViolationList = $this
            ->validator
            ->validate($email, new Email());

        return $validationViolationList->count() === 0;
    }
516017
private function getAccessLevels($email)
    {
        foreach ($this->hostedDomains as $hostedDomain) {
            if (preg_match('/'.$hostedDomain['domain_name'].'$/', $email)) {
                return $hostedDomain['access_levels'];
            }
        }

        return null;
    }
414513
public function isEmailAvailable( $email, $fields = array() )
    {
        $fields = (object) $fields;

        return $this->getMapper()
                    ->isEmailExists(
                          $email,
                          empty( $fields->id ) ? null : $fields->id
                      )
               ? 'user.action.register.email.taken'
               : true;
    }
1326816
public function loadProjectAccessByEmail(Project $project, $email, $reset = false)
    {
        foreach ($this->getProjectAccesses($project, $reset) as $user) {
            $account = $this->getAccount($user);
            if ($account['email'] === $email) {
                return $user;
            }
        }

        return false;
    }
1282580
public function getUserByEmail( $email )
    {
        if ( ! array_key_exists( $email, static::$userCache ) )
        {
            static::$userCache[$email] = $this->getUserMapper()
                                              ->findByEmail( $email );
        }

        return static::$userCache[$email];
    }
544401
public function EmailAvailable($Email = '') {
		$this->_DeliveryType = DELIVERY_TYPE_BOOL;
      $Available = TRUE;

      if (C('Garden.Registration.EmailUnique', TRUE) && $Email != '') {
         $UserModel = Gdn::UserModel();
         if ($UserModel->GetByEmail($Email))
            $Available = FALSE;
      }
      if (!$Available)
         $this->Form->AddError(sprintf(T('%s unavailable'), T('Email')));
         
      $this->Render();
	}
243062
public function getByEmail($email)
    {
        if (!is_string($email) || empty($email)) {
            return null;
        }

        $parameters = array(
            'api_action' => 'contact_view_email',
            'email' => $email
        );

        $response = $this->request($parameters);



        if ($response === null || $response->getStatusCode() !== 200) {
            return null;
        }

        $json = $response->getBody()->getContents();

        return $this->serializer->deserialize(
            $this->removeResultInformation($json),
            \FondOfPHP\ActiveCampaign\DataTransferObject\Contact::class,
            'json'
        );
    }
383795
public function findByEmail($email): ?User
    {
        return DB::table('user')
            ->where('email', '=', $email)
            ->get()
            ->map(User::rowMapper())
            ->first();
    }
461575
public function findUserByEmail($email)
    {
        $qb = $this->createQueryBuilder('user')
            ->where('user.email=:email');

        $query = $qb->getQuery();
        $query->setParameter('email', $email);

        return $query->getSingleResult();
    }