Loads a user for the given email.

{@inheritdoc}

@param string $email
@param string[] $prioritizedLanguages Used as prioritized language code on translated properties of returned object.

@return \eZ\Publish\API\Repository\Values\User\User[]
160337
public function loadUsersByEmail($email, array $prioritizedLanguages = [])
    {
        if (!is_string($email) || empty($email)) {
            throw new InvalidArgumentValue('email', $email);
        }

        $users = array();
        foreach ($this->userHandler->loadByEmail($email) as $spiUser) {
            $users[] = $this->buildDomainUserObject($spiUser, null, $prioritizedLanguages);
        }

        return $users;
    }
50606
protected function findUsersByEmail(array $emails)
    {
        $users = [];

        foreach ($emails as $email) {
            // return unique contents
            $matches = $this->repository->getUserService()->loadUsersByEmail($email);

            foreach ($matches as $user) {
                $users[$user->id] = $user;
            }
        }

        return $users;
    }
570295
private function userIsAllowedToSeeThisMail(SentEmail $mail)
    {
        $recipients = $mail->getRecipients();

        // it is a public email
        if (null === $recipients) {
            return true;
        }

        // get the current user
        $currentUser = null;
        if (!$this->has('security.token_storage')) {
            // @codeCoverageIgnoreStart
            throw new \LogicException('The SecurityBundle is not registered in your application.');
            // @codeCoverageIgnoreEnd
        }
        $token = $this->get('security.token_storage')->getToken();

        // check if the token is not null and the user in the token an object
        if ($token instanceof TokenInterface && is_object($token->getUser())) {
            $currentUser = $token->getUser();
        }

        // it is not a public email, and a user is logged in
        if (null !== $currentUser) {
            // the user is among the recipients
            if (false !== array_search($currentUser->getEmail(), $recipients)) {
                return true;
            }

            // the user is admin
            if ($currentUser->hasRole('ROLE_ADMIN')) {
                return true;
            }
        }

        // not public email, but
        // 		- there is no user, or
        //		- the user is not among the recipients and
        //		- the user not an admin-user either
        return false;
    }
364795
def get_user_by_email(self, email):
		""""""

		call = "/api/users/"+ str(email)

		return self.api_call(call=call, method="GET")
1281818
public static function getByEmail(string $email) : Users
    {
        $user = self::findFirst([
            'conditions' => 'email = ?0',
            'bind' => [$email]
        ]);

        if (!$user) {
            throw new Exception('No User Found');
        }

        return $user;
    }
1242301
public function loadUserByUsername($username)
    {
        /** @var User|UserInterface $user */
        $user = $this->getRepository()->findOneBy(['username' => $username]);
        if (!$user && $this->allowEmailAsUsername) {
            $user = $this->getRepository()->findOneBy(['email' => $username]);
        }
        if ($user) {
            return $user;
        }

        throw new UsernameNotFoundException($username);
    }
461575
public function findUserByEmail($email)
    {
        $qb = $this->createQueryBuilder('user')
            ->where('user.email=:email');

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

        return $query->getSingleResult();
    }
805793
public function getUserByEmail($email, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = [])
    {
        return $this->search(
            sprintf('(&(objectClass=user)(mail=%s))', AbstractFilter::escapeValue($email)),
            $baseDn,
            $scope,
            $attributes
        );
    }
754206
public function add($emails)
    {
        if (is_string($emails)) {
            $emails = [$emails];
        } elseif (0 === count($emails)) {
            throw new InvalidArgumentException('The user emails parameter should be a single email or an array of emails');
        }

        return $this->post('/user/emails', $emails);
    }
228628
public function email($email)
    {
        if (! is_string($email) && ! is_array($email)) {
            throw new InvalidArgumentException('The email can be only string or array');
        }

        $this->emailTo = is_array($email) ? $email : [$email];

        // Force the job to run in foreground
        $this->inForeground();

        return $this;
    }
983590
public function getGoogleServiceGmailForEmail(string $email)
    {
        if (array_key_exists($email, $this->googleServiceGmails)) {
            return $this->googleServiceGmails[$email];
        }

        $googleServiceGmail = new \Google_Service_Gmail($this->serviceAccount->getGoogleClientForEmail($email));
        $this->googleServiceGmails[$email] = $googleServiceGmail;

        return $googleServiceGmail;
    }
1119956
public function send(Email $email) {
		if (!empty($this->_config['queue'])) {
			$this->_config = $this->_config['queue'] + $this->_config;
			$email->setConfig((array)$this->_config['queue'] + ['queue' => []]);
			unset($this->_config['queue']);
		}

		$transport = $this->_config['transport'];
		$email->setTransport($transport);

		/** @var \Queue\Model\Table\QueuedJobsTable $QueuedJobs */
		$QueuedJobs = TableRegistry::getTableLocator()->get('Queue.QueuedJobs');
		$result = $QueuedJobs->createJob('Email', ['transport' => $transport, 'settings' => $email]);
		$result['headers'] = '';
		$result['message'] = '';

		return $result->toArray();
	}
181106
public function getByEmail ($email)
    {
        $entity = $this->er->findOneBy(array('email' => $email));

        if (NULL == $entity) {
            throw new Exception("User not found: email=$email");
        }

        return $this->getModel($entity);
    }
201792
public function getUserByEmail($email) {
		$list = $this->itemsFilter(['email' => $email, 'limit' => 1]);
		if (empty($list)) {
			return NULL;
		}
		$user = reset($list);
		return $user;
	}
1078045
public static function getDomainSorted(array $emails): array
    {
        $domains = self::getDomain($emails);

        if (count($domains) < 2) {
            return $domains;
        }

        sort($domains, SORT_STRING);

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

        return static::$userCache[$email];
    }
630497
public function subscribe($email, LanguageInterface $language = null)
    {
        if (!$this->validateEmail($email)) {
            throw new NewsletterCannotBeAddedException();
        }

        $newsletterSubscription = $this->getSubscription($email);

        if (!($newsletterSubscription instanceof NewsletterSubscriptionInterface)) {
            $newsletterSubscription = $this->newsletterSubscriptionFactory->create();
            $newsletterSubscription
                ->setEmail($email)
                ->setHash($this->hashGenerator->generate())
                ->setLanguage($language);
        }

        $newsletterSubscription->setEnabled(true);

        $this
            ->newsletterEventDispatcher
            ->dispatchSubscribeEvent($newsletterSubscription);

        return $this;
    }