Return's the customer with the passed email and website ID.

@param string $email     The email of the customer to return
@param string $websiteId The website ID of the customer to return

@return array|null The customer
433837
public function findOneByEmailAndWebsiteId($email, $websiteId)
    {

        // initialize the params
        $params = array(
            MemberNames::EMAIL      => $email,
            MemberNames::WEBSITE_ID => $websiteId
        );

        // if not, try to load the customer with the passed email and website ID
        $this->customerByEmailAndWebsiteIdStmt->execute($params);
        return $this->customerByEmailAndWebsiteIdStmt->fetch(\PDO::FETCH_ASSOC);
    }
431431
private function get(string $email, string $listId): array
    {
        try {
            /** @var Collection $result */
            $result = $this->api->request(
                'lists/' . $listId . '/members/' . $this->getHashedEmail($email),
                array(),
                'get'
            );

            // will return the one and only member array('id', ...) from Collection
            return $result->all();
        } catch (\Exception $e) {
            return [];
        }
    }
837968
public function get($page, $pageSize, $websiteId = null, $storeId = null)
    {
        $this
            ->initCollection()
            ->filterMixedParam($websiteId, 'website_id')
            ->filterMixedParam($storeId, 'store_id')
            ->joinAddress('billing')
            ->joinAddress('shipping')
            ->joinSubscriptionStatus()
            ->setPage($page, $pageSize);

        return $this->customersResponseFactory->create()
            ->setCurrentPage($this->customerCollection->getCurPage())
            ->setLastPage($this->customerCollection->getLastPageNumber())
            ->setPageSize($this->customerCollection->getPageSize())
            ->setTotalCount($this->customerCollection->getSize())
            ->setCustomers($this->handleCustomers());
    }
1304665
public static function getDomain($emails): array
    {
        $result = [];

        if (empty($emails)) {
            return $result;
        }

        $emails = self::handleEmailsInput($emails);

        foreach ($emails as $email) {
            if (!self::isValid($email)) {
                continue;
            }

            $domain = self::extractDomain($email);
            if (!empty($domain) && !in_array($domain, $result, true)) {
                $result[] = $domain;
            }
        }

        return $result;
    }
632546
public function loadByEmail($email)
    {
        $query = $this->handler->createSelectQuery();
        $query->select(
            $this->handler->quoteColumn('contentobject_id', 'ezuser'),
            $this->handler->quoteColumn('login', 'ezuser'),
            $this->handler->quoteColumn('email', 'ezuser'),
            $this->handler->quoteColumn('password_hash', 'ezuser'),
            $this->handler->quoteColumn('password_hash_type', 'ezuser'),
            $this->handler->quoteColumn('is_enabled', 'ezuser_setting'),
            $this->handler->quoteColumn('max_login', 'ezuser_setting')
        )->from(
            $this->handler->quoteTable('ezuser')
        )->leftJoin(
            $this->handler->quoteTable('ezuser_setting'),
            $query->expr->eq(
                $this->handler->quoteColumn('user_id', 'ezuser_setting'),
                $this->handler->quoteColumn('contentobject_id', 'ezuser')
            )
        )->where(
            $query->expr->eq(
                $this->handler->quoteColumn('email', 'ezuser'),
                $query->bindValue($email, null, \PDO::PARAM_STR)
            )
        );

        $statement = $query->prepare();
        $statement->execute();

        return $statement->fetchAll(\PDO::FETCH_ASSOC);
    }
538851
public function findUserByUsernameOrEmail($username, $email)
    {
        $dql = '
            SELECT u
            FROM Claroline\CoreBundle\Entity\User u
            WHERE u.username = :username
            OR u.email = :email
            AND u.isRemoved = false
        ';

        $query = $this->_em->createQuery($dql);
        $query->setParameter('username', $username);
        $query->setParameter('email', $email);

        return $query->getResult();
    }
464224
public static function getByEmail($email)
    {
        $fields = self::getDbConnection()->fetchAssoc('SELECT * FROM '.User::TABLE.' WHERE email = ?', array($email));
        if (!$fields) return false;
        return self::fetch($fields);       
  	}
1150231
public function findByEmail($email)
    {
        $qb = $this->createQueryBuilder('u');

        $qb->where($qb->expr()->eq($qb->expr()->lower('u.email'), $qb->expr()->lower($qb->expr()->literal($email))))
            ->andWhere($qb->expr()->isNotNull('u.email'))
            ->andWhere($qb->expr()->eq('u.deleted', $qb->expr()->literal(false)));

        return $qb->getQuery()->getOneOrNullResult();
    }
99268
public function getCustomerByEmail(string $email) : array
    {
        Assert::that($email)->email();

        return (array)$this->master->doRequest(
            'GET',
            sprintf('/admin/WEBAPI/Endpoints/v1_0/CustomerService/{KEY}/GetCustomerByEmail?email=%s', rawurlencode($email))
        );
    }
1101774
public static function search($email, ClientInterface $client = null)
    {

        $response = (new static([], $client))
            ->getClient()
            ->setResourceKey(static::RESOURCE_NAME)
            ->send('/v1/customers/search', 'GET', ['email' => $email]);

        return static::fromArray($response, $client);
    }
97962
public function getProfile($email)
    {
        $url = $this->getProfileUrl($email);

        $httpClient = &$this->httpClient;
        $response = $httpClient->get($url);

        $data = $response->json();

        return $data['entry'][0];
    }
752596
public function getCustomerId($email, $websiteId)
    {
        // lazy loading
        $this->load();

        if (isset($this->_customerIds[$email][$websiteId])) {
            return $this->_customerIds[$email][$websiteId];
        }

        return false;
    }
431045
public function getEmailsForUser($id)
    {
        $oDb = Factory::service('Database');
        $oDb->where('user_id', $id);
        $oDb->order_by('date_added');
        $oDb->order_by('email', 'ASC');
        return $oDb->get($this->tableEmail)->result();
    }
1019836
public function findTokenByEmail($email)
    {
        $user = $this->users->where('email', $email)->first();

        if (! is_null($user)) {
            return $user->getActivationToken();
        }

        return null;
    }
1107643
public function get($email, $default = null)
    {
        $this->setFormat('php');

        $data = unserialize(
            file_get_contents($this->getUrl($email))
        );

        return (is_array($data) && isset($data['entry']))
            ? $data
            : $default;
    }
1067862
static function email2user($email)
    {
        $rcube = rcube::get_instance();
        $plugin = $rcube->plugins->exec_hook('email2user',
            array('email' => $email, 'user' => NULL));

        return $plugin['user'];
    }
1266831
public function getSalesDataForSubscribersWithOrderStatusesAndBrand($emails, $websiteId)
    {
        $orderStatuses = $this->config->getWebsiteConfig(
            Config::XML_PATH_CONNECTOR_SYNC_DATA_FIELDS_STATUS,
            $websiteId
        );
        $orderStatuses = explode(',', $orderStatuses);

        $orderCollection = $this->orderCollectionFactory->create()
            ->addFieldToSelect(['customer_email'])
            ->addExpressionFieldToSelect('total_spend', 'SUM({{grand_total}})', 'grand_total')
            ->addExpressionFieldToSelect('number_of_orders', 'COUNT({{*}})', '*')
            ->addExpressionFieldToSelect('average_order_value', 'AVG({{grand_total}})', 'grand_total')
            ->addFieldToFilter('customer_email', ['in' => $emails]);

        $columns = $this->buildCollectionColumns();
        $orderCollection->getSelect()
            ->columns($columns)
            ->group('customer_email');

        if (! empty($orderStatuses)) {
            $orderCollection->getSelect()->where('status in (?)', $orderStatuses);
        }

        $orderArray = [];
        foreach ($orderCollection as $item) {
            $orderArray[$item->getCustomerEmail()] = $item->toArray(
                [
                    'total_spend',
                    'number_of_orders',
                    'average_order_value',
                    'last_order_date',
                    'first_order_id',
                    'last_order_id',
                    'last_increment_id',
                    'product_id_for_first_brand',
                    'product_id_for_last_brand',
                    'week_day',
                    'month_day',
                    'product_id_for_most_sold_product'
                ]
            );
        }

        return $orderArray;
    }