summaryrefslogtreecommitdiffstats
path: root/examples/helpers/mail/example.php
diff options
context:
space:
mode:
authorElmer Thomas <elmer@thinkingserious.com>2016-06-06 19:29:25 -0700
committerElmer Thomas <elmer@thinkingserious.com>2016-06-06 19:29:25 -0700
commit3f3eba41074bf78f640ad0ef4a092f8a1b32102a (patch)
tree1fb4c005a7afaca4ec9b1ca6b354efac5949a68b /examples/helpers/mail/example.php
parentd8f0703b24f8aedb511701a9651446a339586ff7 (diff)
downloadsendgrid-php-3f3eba41074bf78f640ad0ef4a092f8a1b32102a.zip
sendgrid-php-3f3eba41074bf78f640ad0ef4a092f8a1b32102a.tar.gz
sendgrid-php-3f3eba41074bf78f640ad0ef4a092f8a1b32102a.tar.bz2
Updating dependency to php-http-client
Diffstat (limited to 'examples/helpers/mail/example.php')
-rw-r--r--examples/helpers/mail/example.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/examples/helpers/mail/example.php b/examples/helpers/mail/example.php
index 0e52c46..15e12de 100644
--- a/examples/helpers/mail/example.php
+++ b/examples/helpers/mail/example.php
@@ -2,8 +2,6 @@
namespace SendGrid;
require __DIR__ . '/../../../vendor/autoload.php';
-require __DIR__ . '/../../../lib/SendGrid.php';
-require __DIR__ . '/../../../lib/helpers/mail/Mail.php';
function helloEmail()
@@ -180,25 +178,25 @@ function kitchenSink()
function sendHelloEmail()
{
$apiKey = getenv('SENDGRID_API_KEY');
- $sg = new SendGrid($apiKey);
+ $sg = new \SendGrid($apiKey);
$request_body = helloEmail();
$response = $sg->client->mail()->send()->beta()->post($request_body);
echo $response->statusCode();
- echo $response->responseBody();
- echo $response->responseHeaders();
+ echo $response->body();
+ echo $response->headers();
}
function sendKitchenSink()
{
$apiKey = getenv('SENDGRID_API_KEY');
- $sg = new SendGrid($apiKey);
+ $sg = new \SendGrid($apiKey);
$request_body = kitchenSink();
$response = $sg->client->mail()->send()->beta()->post($request_body);
echo $response->statusCode();
- echo $response->responseBody();
- echo $response->responseHeaders();
+ echo $response->body();
+ echo $response->headers();
}
sendHelloEmail(); // this will actually send an email