Make an API request

@param \SendGrid\Mail\Mail $email A Mail object, containing the request object

@return \SendGrid\Response
483134
public function send(\SendGrid\Mail\Mail $email)
    {
        return $this->client->mail()->send()->post($email);
    }
754881
public function getUrl( $email ){
		$hash	= md5( strtolower( trim( $email ) ) );
		$query	= array(
			's'	=> $this->size,
			'd'	=> $this->default,
			'r'	=> $this->rate,
		);
		return $this->url.$hash.'?'.http_build_query( $query, NULL, '&amp;' );
	}
499658
public function convert(Email $email): \Swift_Message
    {
        $message = $this->createInstance()->setSubject($email->getSubject());
        $message->setBoundary($boundary = \md5(\uniqid()));

        $this->addAddresses($email, $message);
        $this->addParts($email, $message, $boundary);
        $this->addHeaders($email, $message);
        $this->addAttachments($email, $message);

        if ($contentType = $email->getContentType()) {
            $message->setContentType($contentType);
        }

        return $message;
    }
705229
public function delete($email)
	{
		// Build the request path.
		$path = '/user/emails';

		$this->client->setOption('body', json_encode($email));

		return $this->processResponse(
			$this->client->delete($this->fetchUrl($path)),
			204
		);
	}
1212168
public function setEmail($email){
        if(!$this->setModified('email', $email)->isModified()) {
            return $this;
        }
        $this->email = $email;

        return $this;
    }
245169
public static function email($email)
    {
        $html = self::getInstance()->html;
        $args = func_get_args();
        return call_user_func_array(array($html, __FUNCTION__), $args);
    }
52674
public function fetchTokenByEmail(string $email) : ?Token
    {
        return $this->getModel()
                    ->newQuery()
                    ->where('email', $email)
                    ->first();
    }
818083
public function send(CakeEmail $email) {
        if (Configure::read('Mailgun.preventManyToRecipients') !== false && count($email->to()) > 1) {
            throw new Exception('More than one "to" recipient not allowed (set Mailgun.preventManyToRecipients = false to disable check)');
        }

        $mgClient = new Mailgun($this->_config['mg_api_key']);

        $headersList = array('from', 'sender', 'replyTo', 'readReceipt', 'returnPath', 'to', 'cc', 'bcc', 'subject');
        $params = [];
        foreach ($email->getHeaders($headersList) as $header => $value) {
            if (isset($this->_paramMapping[$header]) && !empty($value)) {
                $key = $this->_paramMapping[$header];
                $params[$key] = $value;
            }
        }

        $params['text'] = $email->message(CakeEmail::MESSAGE_TEXT);
        $params['html'] = $email->message(CakeEmail::MESSAGE_HTML);

        $attachments = array();
        foreach ($email->attachments() as $name => $info) {
            $attachments['attachment'][] = '@' . $info['file'];
        }

        try {
            $result = $mgClient->sendMessage($this->_config['mg_domain'], $params, $attachments);
            if ($result->http_response_code != 200) {
                throw new Exception($result->http_response_body->message);
            }
        } catch (Exception $e) {
            throw $e;
        }

        return $result;
    }
1184989
public function subscriberInfo(string $email) : Collection
    {
        try {
            return $this->api->get('lists/'.$this->id().'/members/'.$this->support->hashEmail($email));
        } catch (\Exception $e) {
            # Email address isn't on this list
            if (str_contains($e->getMessage(), 'Resource Not Found')) {
                throw new EmailAddressNotSubscribed;
            }

            throw $e;
        }
    }
1043522
public function sendFromEmail(string $email, \Google_Service_Gmail_Message $message): \Google_Service_Gmail_Message
    {
        return $this->googleServices->getGoogleServiceGmailForEmail($email)->users_messages->send($email, $message);
    }
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);
    }
743492
public function sendEmail($envelope)
    {
        $validate = $envelope->validate();
        if (is_object($validate)) {
            return $validate;
        }

        $parameters = $envelope->buildParameters();
        $this->_action = $envelope->action;
        $this->_method = 'POST';
        $this->_refreshDate();

        $this->_generateSignature($parameters);
        $res = $this->_request();
        if ($res['code'] == 200) {
            if (isset($res['body']->SendRawEmailResult)) {
                return (string) $res['body']->SendRawEmailResult->MessageId;
            }
            
            return (string) $res['body']->SendEmailResult->MessageId;
        } else {
            return new SimpleEmailServiceError((string) $res['body']->Error->Code);
        }
    }
588595
public function from($name, $email)
    {
        $this->from_email = $email;
        $this->from_name = $name;

        return $this;
    }
1202586
public function getSenderActivationMail($email)
    {
        if (empty($email)) {
            return $this->handleError('Empty email');
        }

        $requestResult = $this->sendRequest('senders/' . $email . '/code');

        return $this->handleResult($requestResult);
    }
529280
public function changeEmail($email)
    {
        if ($email !== $this->email) {
            $this->email = $email;

            $this->raise(new EmailChanged($this));
        }

        return $this;
    }
1052742
public function createUser($email)
    {
        $contents = $this
            ->call('POST', self::USERS_RESOURCE, ['json' => [
                'email' => $email,
            ]], false)
            ->getBody()
            ->getContents()
        ;

        return UserModel::createFromJsonResponse($contents);
    }
949410
public function withUnverifiedEmail($email)
    {
        $request = clone $this;
        $request->email = $email instanceof Email ? $email : new Email($email);
        $request->emailIsVerified = false;

        return $request;
    }