Get a subscriber

@param string $email
@param string $listId
@return array
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 [];
        }
    }
201792
public function getUserByEmail($email) {
		$list = $this->itemsFilter(['email' => $email, 'limit' => 1]);
		if (empty($list)) {
			return NULL;
		}
		$user = reset($list);
		return $user;
	}
111958
public function postAddressBookContactResubscribe($addressBookId, $email)
    {
        $contact = ['unsubscribedContact' => ['email' => $email]];
        $url = $this->getApiEndpoint() . Client::REST_ADDRESS_BOOKS . $addressBookId
            . '/contacts/resubscribe';
        $this->setUrl($url)
            ->setVerb('POST')
            ->buildPostBody($contact);

        $response = $this->execute();

        if (isset($response->message)) {
            $message = 'POST ADDRESS BOOK CONTACT RESUBSCRIBE ' . $url . ', '
                . $response->message;
            $this->helper->debug('postAddressBookContactResubscribe', [$message]);
        }

        return $response;
    }
483054
public function findById($listId)
    {
        $listData = $this->mailchimp->get("lists/$listId");

        if (!$this->mailchimp->success()) {
            $this->throwMailchimpError($this->mailchimp->getLastResponse());
        }
        return $listData;
    }
669748
public function addSubscriber($listId = '', $subscriber = array())
    {
        $settings = CmService::$plugin->getSettings();

        try {
            $auth = array(
                'api_key' => (string)$settings->apiKey);
            $client = new \CS_REST_Subscribers(
                $listId,
                $auth);
            $result = $client->add($subscriber);

            if($result->was_successful()) {
                $body = $result->response;
                return [
                    'success' => true,
                    'statusCode' => $result->http_status_code,
                    'body' => $body
                ];
            } else {
                return [
                    'success' => false,
                    'statusCode' => $result->http_status_code,
                    'reason' => $result->response->Message
                ];
            }
        } catch (\Exception $e) {
            return [
                'success' => false,
                'reason' => $e->getMessage()
            ];
        }
    }
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;
    }
661426
public function get_by_email( $email, $args = array() ) {

		$this->set_request_args( array(
			'method' => 'GET',
			'path'   => array( 'email', urlencode( $email ) ),
			'params' => $args,
		) );

		return $this->do_request();
	}
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))
        );
    }
562215
public void mailingList_subscribe_POST(String email, String mailingList) throws IOException {
		String qPath = "/me/mailingList/subscribe";
		StringBuilder sb = path(qPath);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "email", email);
		addBody(o, "mailingList", mailingList);
		exec(qPath, "POST", sb.toString(), o);
	}
683130
public function postSubscribe(Request $request) {

        // Does the email ID exist in the "list_emails" table for this list ID already?
        // We need the email ID, but only have an email address. See if this email address exists in the "emails" db table
        if ($this->subscribeToList->getEmailIDByTitle($request->input('email'))) {

            // yes, the email address exists in the "emails" db table
            if ($this->subscribeToList->getList_emailByEmailIdAndListId(
                   $this->subscribeToList->getEmailIDByTitle($request->input('email')),
                   $request->input('listID')
                )
            ) {
                return view('lasallecrmlistmanagement::subscribe-unsubscribe-list.subscribe_email_already_in_list', [
                    'title'             => $this->subscribeToList->getListnameByListId($request->input('listID')),
                    'email'             => $request->input('email')
                ]);
            }

        }


        // Add email to the email list
        $emailID = $this->subscribeToList->getEmailIDByTitle($request->input('email'));

        if (!$emailID) {

            // The email address does NOT exist in the "emails" db table.
            // So, create the email address in the "emails" db table
            // (i) prep the data
            $data = $this->subscribeToList->prepareEmailDataForInsert($request);

            // (ii) create the new record
            $emailID = $this->subscribeToList->createNewEmailRecord($data);
        }

        // if the INSERT to the "emails" db table failed, then try the subscribe all over again
        if (!$emailID) {
            $message = "Something did not quite go right in the processing. Please try again.";
            Session::flash('message', $message);
            return redirect('list/subscribe/'.$request->input('listID'))
                ->withInput()
            ;
        }


        // INSERT INTO list_email
        // consolidate POST vars and processed data into one array
        $input = array_merge($request->all(),['emailID' => $emailID]);

        // prep the data for the INSERT
        $data = $this->subscribeToList->prepareList_emailDataForInsert($input);

        // INSERT record
        $list_emailID = $this->subscribeToList->createNewList_emailRecord($data);

        // if the INSERT into the "list_email" db table failed, then try the subscribe all over again
        if (!$list_emailID) {
            $message = "Something did not go quite right in the processing. Please try again.";
            Session::flash('message', $message);
            return redirect('list/subscribe/'.$request->input('listID'))
                ->withInput()
                ;
        }


        if ($request->has('surname')) {


            $peopleID = $this->subscribeToList->isFirstnameSurname($request->input('first_name'), $request->input('surname'));

            if (!$peopleID) {
                // prep the data for the INSERT
                $data = $this->subscribeToList->preparePeoplesDataForInsert($input);

                // INSERT record
                $peopleID = $this->subscribeToList->createNewPeoplesRecord($data);
            }


            if ($peopleID) {
                // INSERT INTO people_email
                $people_emailID = $this->subscribeToList->createNewPeople_emailRecord(['people_id' => $peopleID, 'email_id' => $emailID]);
            }


            if (!$people_emailID) {
                // whaddaya mean the INSERT INTO "people_email" failed?! try again...
                $people_emailID = $this->subscribeToList->createNewPeople_emailRecord(['people_id' => $peopleID, 'email_id' => $emailID]);
            }
        }

        return view('lasallecrmlistmanagement::subscribe-unsubscribe-list.subscribe_success', [
            'title'             => $this->subscribeToList->getListnameByListId($request->input('listID')),
            'email'             => $request->input('email')
        ]);
    }
24583
public OvhTaskMl domain_mailingList_name_subscriber_POST(String domain, String name, String email) throws IOException {
		String qPath = "/email/domain/{domain}/mailingList/{name}/subscriber";
		StringBuilder sb = path(qPath, domain, name);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "email", email);
		String resp = exec(qPath, "POST", sb.toString(), o);
		return convertTo(resp, OvhTaskMl.class);
	}
33033
public function getMemberById($email)
    {
        $timeStamp = time();
        $result = $this->em->getRepository($this->entity['m']['name'])->findOneBy(array('id' => $email));
        if (is_null($result)) {
            return new ModelResponse($result, 0, 0, null, true, 'E:D:002', 'Unable to find request entry in database.', $timeStamp, time());
        }
        return new ModelResponse($result, 1, 0, null, false, 'S:D:002', 'Entries successfully fetched from database.', $timeStamp, time());
    }
1168481
public function getSubscriptionCredentials($email, $password)
    {
        // Build a light authenticator.
        $signature = new Signature($password);
        $signature->getNoncer()->setLength(self::NONCE_LENGTH);
        $authentiator = array(
            'time' => $signature->getRequestTime(),
            'hash' => $signature->generate(),
            'nonce' => $signature->getNonce(),
        );
        $params = array(
            'authenticator' => $authentiator,
            'body' => array('email' => $email),
        );

        $response = $this->call('acquia.agent.subscription.credentials', $params);
        // @todo catch error and/or check response is_error
        // @todo set this key/id
        return $response;
    }
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);
    }
467691
public function createTokenRecord($emailID, $listID, $token) {

        $unsubscribe = new List_Unsubscribe_Token;

        $unsubscribe->email_id = $emailID;
        $unsubscribe->list_id  = $listID;
        $unsubscribe->token    = $token;

        $unsubscribe->save();
    }
290695
public function getEmailInfo($bookID, $email)
    {
        if (empty($bookID) || empty($email)) {
            return $this->handleError('Empty book id or email');
        }

        $requestResult = $this->sendRequest('addressbooks/' . $bookID . '/emails/' . $email);

        return $this->handleResult($requestResult);
    }
1073280
public function getByEmail($email)
    {
        $filter = new IteratorFilter();
        $filter->addRelation($this->getUserDefinition()->getEmail(), Relation::EQUAL, strtolower($email));
        return $this->getUser($filter);
    }