diff options
37 files changed, 23 insertions, 6240 deletions
diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/examples/example.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/examples/example.php deleted file mode 100644 index 4ec9c73..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/examples/example.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -// If running this outside of this context, use the following include and -// comment out the two includes below -// require __DIR__ . '/vendor/autoload.php'; -include(dirname(__DIR__) . '/lib/Client.php'); -// This gets the parent directory, for your current directory use getcwd() -$path_to_config = dirname(__DIR__); -$apiKey = getenv('SENDGRID_API_KEY'); -$headers = ['Authorization: Bearer ' . $apiKey]; -$client = new SendGrid\Client('https://api.sendgrid.com', $headers, '/v3'); - -// GET Collection -$query_params = ['limit' => 100, 'offset' => 0]; -$request_headers = ['X-Mock: 200']; -$response = $client->api_keys()->get(null, $query_params, $request_headers); -echo $response->statusCode(); -echo $response->body(); -echo $response->headers(); - -// GET with auto retry on rate limit -$query_params = ['limit' => 100, 'offset' => 0]; -$request_headers = ['X-Mock: 200']; -$retryOnLimit = true; -$response = $client->api_keys()->get(null, $query_params, $request_headers, $retryOnLimit); -echo $response->statusCode(); -echo $response->body(); -echo $response->headers(); - -// POST -$request_body = [ - 'name' => 'My PHP API Key', - 'scopes' => [ - 'mail.send', - 'alerts.create', - 'alerts.read' - ] -]; -$response = $client->api_keys()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -echo $response->headers(); -$response_body = json_decode($response->body()); -$api_key_id = $response_body->api_key_id; - -// GET Single -$response = $client->version('/v3')->api_keys()->_($api_key_id)->get(); -echo $response->statusCode(); -echo $response->body(); -echo $response->headers(); - -// PATCH -$request_body = [ - 'name' => 'A New Hope' -]; -$response = $client->api_keys()->_($api_key_id)->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -echo $response->headers(); - -// PUT -$request_body = [ - 'name' => 'A New Hope', - 'scopes' => [ - 'user.profile.read', - 'user.profile.update' - ] -]; -$response = $client->api_keys()->_($api_key_id)->put($request_body); -echo $response->statusCode(); -echo $response->body(); -echo $response->headers(); - -// DELETE -$response = $client->api_keys()->_($api_key_id)->delete(); -echo $response->statusCode(); -echo $response->body(); -echo $response->headers(); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/test/unit/ClientTest.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/test/unit/ClientTest.php deleted file mode 100644 index 676f600..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/test/unit/ClientTest.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php - -namespace SendGrid\Test; - -use SendGrid\Client; - -class ClientTest extends \PHPUnit_Framework_TestCase -{ - /** @var MockClient */ - private $client; - /** @var string */ - private $host; - /** @var array */ - private $headers; - - protected function setUp() - { - $this->host = 'https://localhost:4010'; - $this->headers = [ - 'Content-Type: application/json', - 'Authorization: Bearer SG.XXXX' - ]; - $this->client = new MockClient($this->host, $this->headers, '/v3', null, null); - } - - public function testConstructor() - { - $this->assertAttributeEquals($this->host, 'host', $this->client); - $this->assertAttributeEquals($this->headers, 'headers', $this->client); - $this->assertAttributeEquals('/v3', 'version', $this->client); - $this->assertAttributeEquals([], 'path', $this->client); - $this->assertAttributeEquals([], 'curlOptions', $this->client); - $this->assertAttributeEquals(['delete', 'get', 'patch', 'post', 'put'], 'methods', $this->client); - } - - public function test_() - { - $client = new MockClient($this->host, $this->headers, '/v3', null, ['foo' => 'bar']); - $client = $client->_('test'); - - $this->assertAttributeEquals(['test'], 'path', $client); - $this->assertAttributeEquals(['foo' => 'bar'], 'curlOptions', $client); - } - - public function test__call() - { - $client = $this->client->get(); - $this->assertAttributeEquals('https://localhost:4010/v3/', 'url', $client); - - $queryParams = ['limit' => 100, 'offset' => 0]; - $client = $this->client->get(null, $queryParams); - $this->assertAttributeEquals('https://localhost:4010/v3/?limit=100&offset=0', 'url', $client); - - $requestBody = ['name' => 'A New Hope']; - $client = $this->client->get($requestBody); - $this->assertAttributeEquals($requestBody, 'requestBody', $client); - - $requestHeaders = ['X-Mock: 200']; - $client = $this->client->get(null, null, $requestHeaders); - $this->assertAttributeEquals($requestHeaders, 'requestHeaders', $client); - - $client = $this->client->version('/v4'); - $this->assertAttributeEquals('/v4', 'version', $client); - - $client = $this->client->path_to_endpoint(); - $this->assertAttributeEquals(['path_to_endpoint'], 'path', $client); - $client = $client->one_more_segment(); - $this->assertAttributeEquals(['path_to_endpoint', 'one_more_segment'], 'path', $client); - } - - public function testGetHost() - { - $client = new Client('https://localhost:4010'); - $this->assertSame('https://localhost:4010', $client->getHost()); - } - - public function testGetHeaders() - { - $client = new Client('https://localhost:4010', ['Content-Type: application/json', 'Authorization: Bearer SG.XXXX']); - $this->assertSame(['Content-Type: application/json', 'Authorization: Bearer SG.XXXX'], $client->getHeaders()); - - $client2 = new Client('https://localhost:4010', null); - $this->assertSame([], $client2->getHeaders()); - } - - public function testGetVersion() - { - $client = new Client('https://localhost:4010', null, '/v3'); - $this->assertSame('/v3', $client->getVersion()); - - $client = new Client('https://localhost:4010', null, null); - $this->assertSame(null, $client->getVersion()); - } - - public function testGetPath() - { - $client = new Client('https://localhost:4010', null, null, ['/foo/bar']); - $this->assertSame(['/foo/bar'], $client->getPath()); - - $client = new Client('https://localhost:4010', null, null, null); - $this->assertSame([], $client->getPath()); - } - - public function testGetCurlOptions() - { - $client = new Client('https://localhost:4010', null, null, null, [CURLOPT_PROXY => '127.0.0.1:8080']); - $this->assertSame([CURLOPT_PROXY => '127.0.0.1:8080'], $client->getCurlOptions()); - - $client = new Client('https://localhost:4010', null, null, null, null); - $this->assertSame([], $client->getCurlOptions()); - } -} diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/test/unit/MockClient.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/test/unit/MockClient.php deleted file mode 100644 index ae7ed79..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/test/unit/MockClient.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace SendGrid\Test; - -use SendGrid\Client; - -class MockClient extends Client -{ - protected $requestBody; - protected $requestHeaders; - protected $url; - - public function makeRequest($method, $url, $requestBody = null, $requestHeaders = null, $retryOnLimit = false) - { - $this->requestBody = $requestBody; - $this->requestHeaders = $requestHeaders; - $this->url = $url; - return $this; - } -} diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/test/unit/ResponseTest.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/test/unit/ResponseTest.php deleted file mode 100644 index 45660e2..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/test/unit/ResponseTest.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -namespace SendGrid\Test; - -use SendGrid\Response; - -class ResponseTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $response = new Response(); - - $this->assertAttributeEquals(null, 'statusCode', $response); - $this->assertAttributeEquals(null, 'body', $response); - $this->assertAttributeEquals(null, 'headers', $response); - - $response = new Response(200, 'test', ['Content-Encoding: gzip']); - - $this->assertAttributeEquals(200, 'statusCode', $response); - $this->assertAttributeEquals('test', 'body', $response); - $this->assertAttributeEquals(['Content-Encoding: gzip'], 'headers', $response); - } - - public function testStatusCode() - { - $response = new Response(404); - - $this->assertEquals(404, $response->statusCode()); - } - - public function testBody() - { - $response = new Response(null, 'foo'); - - $this->assertEquals('foo', $response->body()); - } - - public function testHeaders() - { - $response = new Response(null, null, ['Content-Type: text/html']); - - $this->assertEquals(['Content-Type: text/html'], $response->headers()); - } - - public function testAssociativeHeaders() - { - $response = new Response(null, null, ['Content-Type: text/html', 'HTTP/1.1 200 OK']); - - $this->assertEquals(['Content-Type' => 'text/html', 'Status' => 'HTTP/1.1 200 OK'], $response->headers(true)); - } -} diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/test/unit/bootstrap.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/test/unit/bootstrap.php deleted file mode 100644 index 19d4b20..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/test/unit/bootstrap.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php - -require __DIR__ . '/../../vendor/autoload.php'; diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/accesssettings/accesssettings.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/accesssettings/accesssettings.php deleted file mode 100644 index 64ef5f0..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/accesssettings/accesssettings.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Retrieve all recent access attempts # -// GET /access_settings/activity # - -$query_params = json_decode('{"limit": 1}'); -$response = $sg->client->access_settings()->activity()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Add one or more IPs to the whitelist # -// POST /access_settings/whitelist # - -$request_body = json_decode('{ - "ips": [ - { - "ip": "192.168.1.1" - }, - { - "ip": "192.*.*.*" - }, - { - "ip": "192.168.1.3/32" - } - ] -}'); -$response = $sg->client->access_settings()->whitelist()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a list of currently whitelisted IPs # -// GET /access_settings/whitelist # - -$response = $sg->client->access_settings()->whitelist()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Remove one or more IPs from the whitelist # -// DELETE /access_settings/whitelist # - -$request_body = json_decode('{ - "ids": [ - 1, - 2, - 3 - ] -}'); -$response = $sg->client->access_settings()->whitelist()->delete($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a specific whitelisted IP # -// GET /access_settings/whitelist/{rule_id} # - -$rule_id = "test_url_param"; -$response = $sg->client->access_settings()->whitelist()->_($rule_id)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Remove a specific IP from the whitelist # -// DELETE /access_settings/whitelist/{rule_id} # - -$rule_id = "test_url_param"; -$response = $sg->client->access_settings()->whitelist()->_($rule_id)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/alerts/alerts.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/alerts/alerts.php deleted file mode 100644 index 7414200..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/alerts/alerts.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Create a new Alert # -// POST /alerts # - -$request_body = json_decode('{ - "email_to": "example@example.com", - "frequency": "daily", - "type": "stats_notification" -}'); -$response = $sg->client->alerts()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all alerts # -// GET /alerts # - -$response = $sg->client->alerts()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update an alert # -// PATCH /alerts/{alert_id} # - -$request_body = json_decode('{ - "email_to": "example@example.com" -}'); -$alert_id = "test_url_param"; -$response = $sg->client->alerts()->_($alert_id)->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a specific alert # -// GET /alerts/{alert_id} # - -$alert_id = "test_url_param"; -$response = $sg->client->alerts()->_($alert_id)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete an alert # -// DELETE /alerts/{alert_id} # - -$alert_id = "test_url_param"; -$response = $sg->client->alerts()->_($alert_id)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/apikeys/apikeys.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/apikeys/apikeys.php deleted file mode 100644 index 7b344f5..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/apikeys/apikeys.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Create API keys # -// POST /api_keys # - -$request_body = json_decode('{ - "name": "My API Key", - "sample": "data", - "scopes": [ - "mail.send", - "alerts.create", - "alerts.read" - ] -}'); -$response = $sg->client->api_keys()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all API Keys belonging to the authenticated user # -// GET /api_keys # - -$query_params = json_decode('{"limit": 1}'); -$response = $sg->client->api_keys()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update the name & scopes of an API Key # -// PUT /api_keys/{api_key_id} # - -$request_body = json_decode('{ - "name": "A New Hope", - "scopes": [ - "user.profile.read", - "user.profile.update" - ] -}'); -$api_key_id = "test_url_param"; -$response = $sg->client->api_keys()->_($api_key_id)->put($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update API keys # -// PATCH /api_keys/{api_key_id} # - -$request_body = json_decode('{ - "name": "A New Hope" -}'); -$api_key_id = "test_url_param"; -$response = $sg->client->api_keys()->_($api_key_id)->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve an existing API Key # -// GET /api_keys/{api_key_id} # - -$api_key_id = "test_url_param"; -$response = $sg->client->api_keys()->_($api_key_id)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete API keys # -// DELETE /api_keys/{api_key_id} # - -$api_key_id = "test_url_param"; -$response = $sg->client->api_keys()->_($api_key_id)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/asm/asm.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/asm/asm.php deleted file mode 100644 index 6edd2cf..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/asm/asm.php +++ /dev/null @@ -1,174 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Create a new suppression group # -// POST /asm/groups # - -$request_body = json_decode('{ - "description": "Suggestions for products our users might like.", - "is_default": true, - "name": "Product Suggestions" -}'); -$response = $sg->client->asm()->groups()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve information about multiple suppression groups # -// GET /asm/groups # - -$query_params = json_decode('{"id": 1}'); -$response = $sg->client->asm()->groups()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update a suppression group. # -// PATCH /asm/groups/{group_id} # - -$request_body = json_decode('{ - "description": "Suggestions for items our users might like.", - "id": 103, - "name": "Item Suggestions" -}'); -$group_id = "test_url_param"; -$response = $sg->client->asm()->groups()->_($group_id)->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Get information on a single suppression group. # -// GET /asm/groups/{group_id} # - -$group_id = "test_url_param"; -$response = $sg->client->asm()->groups()->_($group_id)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a suppression group. # -// DELETE /asm/groups/{group_id} # - -$group_id = "test_url_param"; -$response = $sg->client->asm()->groups()->_($group_id)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Add suppressions to a suppression group # -// POST /asm/groups/{group_id}/suppressions # - -$request_body = json_decode('{ - "recipient_emails": [ - "test1@example.com", - "test2@example.com" - ] -}'); -$group_id = "test_url_param"; -$response = $sg->client->asm()->groups()->_($group_id)->suppressions()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all suppressions for a suppression group # -// GET /asm/groups/{group_id}/suppressions # - -$group_id = "test_url_param"; -$response = $sg->client->asm()->groups()->_($group_id)->suppressions()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Search for suppressions within a group # -// POST /asm/groups/{group_id}/suppressions/search # - -$request_body = json_decode('{ - "recipient_emails": [ - "exists1@example.com", - "exists2@example.com", - "doesnotexists@example.com" - ] -}'); -$group_id = "test_url_param"; -$response = $sg->client->asm()->groups()->_($group_id)->suppressions()->search()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a suppression from a suppression group # -// DELETE /asm/groups/{group_id}/suppressions/{email} # - -$group_id = "test_url_param"; -$email = "test_url_param"; -$response = $sg->client->asm()->groups()->_($group_id)->suppressions()->_($email)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all suppressions # -// GET /asm/suppressions # - -$response = $sg->client->asm()->suppressions()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Add recipient addresses to the global suppression group. # -// POST /asm/suppressions/global # - -$request_body = json_decode('{ - "recipient_emails": [ - "test1@example.com", - "test2@example.com" - ] -}'); -$response = $sg->client->asm()->suppressions()->global()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a Global Suppression # -// GET /asm/suppressions/global/{email} # - -$email = "test_url_param"; -$response = $sg->client->asm()->suppressions()->global()->_($email)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a Global Suppression # -// DELETE /asm/suppressions/global/{email} # - -$email = "test_url_param"; -$response = $sg->client->asm()->suppressions()->global()->_($email)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all suppression groups for an email address # -// GET /asm/suppressions/{email} # - -$email = "test_url_param"; -$response = $sg->client->asm()->suppressions()->_($email)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/browsers/browsers.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/browsers/browsers.php deleted file mode 100644 index fffbbcf..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/browsers/browsers.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Retrieve email statistics by browser. # -// GET /browsers/stats # - -$query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "browsers": "test_string", "limit": "test_string", "offset": "test_string", "start_date": "2016-01-01"}'); -$response = $sg->client->browsers()->stats()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/campaigns/campaigns.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/campaigns/campaigns.php deleted file mode 100644 index df2732f..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/campaigns/campaigns.php +++ /dev/null @@ -1,154 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Create a Campaign # -// POST /campaigns # - -$request_body = json_decode('{ - "categories": [ - "spring line" - ], - "custom_unsubscribe_url": "", - "html_content": "<html><head><title></title></head><body><p>Check out our spring line!</p></body></html>", - "ip_pool": "marketing", - "list_ids": [ - 110, - 124 - ], - "plain_content": "Check out our spring line!", - "segment_ids": [ - 110 - ], - "sender_id": 124451, - "subject": "New Products for Spring!", - "suppression_group_id": 42, - "title": "March Newsletter" -}'); -$response = $sg->client->campaigns()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all Campaigns # -// GET /campaigns # - -$query_params = json_decode('{"limit": 1, "offset": 1}'); -$response = $sg->client->campaigns()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update a Campaign # -// PATCH /campaigns/{campaign_id} # - -$request_body = json_decode('{ - "categories": [ - "summer line" - ], - "html_content": "<html><head><title></title></head><body><p>Check out our summer line!</p></body></html>", - "plain_content": "Check out our summer line!", - "subject": "New Products for Summer!", - "title": "May Newsletter" -}'); -$campaign_id = "test_url_param"; -$response = $sg->client->campaigns()->_($campaign_id)->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a single campaign # -// GET /campaigns/{campaign_id} # - -$campaign_id = "test_url_param"; -$response = $sg->client->campaigns()->_($campaign_id)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a Campaign # -// DELETE /campaigns/{campaign_id} # - -$campaign_id = "test_url_param"; -$response = $sg->client->campaigns()->_($campaign_id)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update a Scheduled Campaign # -// PATCH /campaigns/{campaign_id}/schedules # - -$request_body = json_decode('{ - "send_at": 1489451436 -}'); -$campaign_id = "test_url_param"; -$response = $sg->client->campaigns()->_($campaign_id)->schedules()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Schedule a Campaign # -// POST /campaigns/{campaign_id}/schedules # - -$request_body = json_decode('{ - "send_at": 1489771528 -}'); -$campaign_id = "test_url_param"; -$response = $sg->client->campaigns()->_($campaign_id)->schedules()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// View Scheduled Time of a Campaign # -// GET /campaigns/{campaign_id}/schedules # - -$campaign_id = "test_url_param"; -$response = $sg->client->campaigns()->_($campaign_id)->schedules()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Unschedule a Scheduled Campaign # -// DELETE /campaigns/{campaign_id}/schedules # - -$campaign_id = "test_url_param"; -$response = $sg->client->campaigns()->_($campaign_id)->schedules()->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Send a Campaign # -// POST /campaigns/{campaign_id}/schedules/now # - -$campaign_id = "test_url_param"; -$response = $sg->client->campaigns()->_($campaign_id)->schedules()->now()->post(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Send a Test Campaign # -// POST /campaigns/{campaign_id}/schedules/test # - -$request_body = json_decode('{ - "to": "your.email@example.com" -}'); -$campaign_id = "test_url_param"; -$response = $sg->client->campaigns()->_($campaign_id)->schedules()->test()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/categories/categories.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/categories/categories.php deleted file mode 100644 index bdc9d21..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/categories/categories.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Retrieve all categories # -// GET /categories # - -$query_params = json_decode('{"category": "test_string", "limit": 1, "offset": 1}'); -$response = $sg->client->categories()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve Email Statistics for Categories # -// GET /categories/stats # - -$query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "categories": "test_string"}'); -$response = $sg->client->categories()->stats()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve sums of email stats for each category [Needs: Stats object defined, has category ID?] # -// GET /categories/stats/sums # - -$query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "start_date": "2016-01-01", "sort_by_direction": "asc"}'); -$response = $sg->client->categories()->stats()->sums()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/clients/clients.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/clients/clients.php deleted file mode 100644 index 797fa38..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/clients/clients.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Retrieve email statistics by client type. # -// GET /clients/stats # - -$query_params = json_decode('{"aggregated_by": "day", "start_date": "2016-01-01", "end_date": "2016-04-01"}'); -$response = $sg->client->clients()->stats()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve stats by a specific client type. # -// GET /clients/{client_type}/stats # - -$query_params = json_decode('{"aggregated_by": "day", "start_date": "2016-01-01", "end_date": "2016-04-01"}'); -$client_type = "test_url_param"; -$response = $sg->client->clients()->_($client_type)->stats()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/contactdb/contactdb.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/contactdb/contactdb.php deleted file mode 100644 index 277048f..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/contactdb/contactdb.php +++ /dev/null @@ -1,396 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Create a Custom Field # -// POST /contactdb/custom_fields # - -$request_body = json_decode('{ - "name": "pet", - "type": "text" -}'); -$response = $sg->client->contactdb()->custom_fields()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all custom fields # -// GET /contactdb/custom_fields # - -$response = $sg->client->contactdb()->custom_fields()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a Custom Field # -// GET /contactdb/custom_fields/{custom_field_id} # - -$custom_field_id = "test_url_param"; -$response = $sg->client->contactdb()->custom_fields()->_($custom_field_id)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a Custom Field # -// DELETE /contactdb/custom_fields/{custom_field_id} # - -$custom_field_id = "test_url_param"; -$response = $sg->client->contactdb()->custom_fields()->_($custom_field_id)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Create a List # -// POST /contactdb/lists # - -$request_body = json_decode('{ - "name": "your list name" -}'); -$response = $sg->client->contactdb()->lists()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all lists # -// GET /contactdb/lists # - -$response = $sg->client->contactdb()->lists()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete Multiple lists # -// DELETE /contactdb/lists # - -$request_body = json_decode('[ - 1, - 2, - 3, - 4 -]'); -$response = $sg->client->contactdb()->lists()->delete($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update a List # -// PATCH /contactdb/lists/{list_id} # - -$request_body = json_decode('{ - "name": "newlistname" -}'); -$query_params = json_decode('{"list_id": 1}'); -$list_id = "test_url_param"; -$response = $sg->client->contactdb()->lists()->_($list_id)->patch($request_body, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a single list # -// GET /contactdb/lists/{list_id} # - -$query_params = json_decode('{"list_id": 1}'); -$list_id = "test_url_param"; -$response = $sg->client->contactdb()->lists()->_($list_id)->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a List # -// DELETE /contactdb/lists/{list_id} # - -$query_params = json_decode('{"delete_contacts": "true"}'); -$list_id = "test_url_param"; -$response = $sg->client->contactdb()->lists()->_($list_id)->delete(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Add Multiple Recipients to a List # -// POST /contactdb/lists/{list_id}/recipients # - -$request_body = json_decode('[ - "recipient_id1", - "recipient_id2" -]'); -$list_id = "test_url_param"; -$response = $sg->client->contactdb()->lists()->_($list_id)->recipients()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all recipients on a List # -// GET /contactdb/lists/{list_id}/recipients # - -$query_params = json_decode('{"page": 1, "page_size": 1, "list_id": 1}'); -$list_id = "test_url_param"; -$response = $sg->client->contactdb()->lists()->_($list_id)->recipients()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Add a Single Recipient to a List # -// POST /contactdb/lists/{list_id}/recipients/{recipient_id} # - -$list_id = "test_url_param"; -$recipient_id = "test_url_param"; -$response = $sg->client->contactdb()->lists()->_($list_id)->recipients()->_($recipient_id)->post(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a Single Recipient from a Single List # -// DELETE /contactdb/lists/{list_id}/recipients/{recipient_id} # - -$query_params = json_decode('{"recipient_id": 1, "list_id": 1}'); -$list_id = "test_url_param"; -$recipient_id = "test_url_param"; -$response = $sg->client->contactdb()->lists()->_($list_id)->recipients()->_($recipient_id)->delete(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update Recipient # -// PATCH /contactdb/recipients # - -$request_body = json_decode('[ - { - "email": "jones@example.com", - "first_name": "Guy", - "last_name": "Jones" - } -]'); -$response = $sg->client->contactdb()->recipients()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Add recipients # -// POST /contactdb/recipients # - -$request_body = json_decode('[ - { - "age": 25, - "email": "example@example.com", - "first_name": "", - "last_name": "User" - }, - { - "age": 25, - "email": "example2@example.com", - "first_name": "Example", - "last_name": "User" - } -]'); -$response = $sg->client->contactdb()->recipients()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve recipients # -// GET /contactdb/recipients # - -$query_params = json_decode('{"page": 1, "page_size": 1}'); -$response = $sg->client->contactdb()->recipients()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete Recipient # -// DELETE /contactdb/recipients # - -$request_body = json_decode('[ - "recipient_id1", - "recipient_id2" -]'); -$response = $sg->client->contactdb()->recipients()->delete($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve the count of billable recipients # -// GET /contactdb/recipients/billable_count # - -$response = $sg->client->contactdb()->recipients()->billable_count()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a Count of Recipients # -// GET /contactdb/recipients/count # - -$response = $sg->client->contactdb()->recipients()->count()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve recipients matching search criteria # -// GET /contactdb/recipients/search # - -$query_params = json_decode('{"{field_name}": "test_string"}'); -$response = $sg->client->contactdb()->recipients()->search()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a single recipient # -// GET /contactdb/recipients/{recipient_id} # - -$recipient_id = "test_url_param"; -$response = $sg->client->contactdb()->recipients()->_($recipient_id)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a Recipient # -// DELETE /contactdb/recipients/{recipient_id} # - -$recipient_id = "test_url_param"; -$response = $sg->client->contactdb()->recipients()->_($recipient_id)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve the lists that a recipient is on # -// GET /contactdb/recipients/{recipient_id}/lists # - -$recipient_id = "test_url_param"; -$response = $sg->client->contactdb()->recipients()->_($recipient_id)->lists()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve reserved fields # -// GET /contactdb/reserved_fields # - -$response = $sg->client->contactdb()->reserved_fields()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Create a Segment # -// POST /contactdb/segments # - -$request_body = json_decode('{ - "conditions": [ - { - "and_or": "", - "field": "last_name", - "operator": "eq", - "value": "Miller" - }, - { - "and_or": "and", - "field": "last_clicked", - "operator": "gt", - "value": "01/02/2015" - }, - { - "and_or": "or", - "field": "clicks.campaign_identifier", - "operator": "eq", - "value": "513" - } - ], - "list_id": 4, - "name": "Last Name Miller" -}'); -$response = $sg->client->contactdb()->segments()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all segments # -// GET /contactdb/segments # - -$response = $sg->client->contactdb()->segments()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update a segment # -// PATCH /contactdb/segments/{segment_id} # - -$request_body = json_decode('{ - "conditions": [ - { - "and_or": "", - "field": "last_name", - "operator": "eq", - "value": "Miller" - } - ], - "list_id": 5, - "name": "The Millers" -}'); -$query_params = json_decode('{"segment_id": "test_string"}'); -$segment_id = "test_url_param"; -$response = $sg->client->contactdb()->segments()->_($segment_id)->patch($request_body, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a segment # -// GET /contactdb/segments/{segment_id} # - -$query_params = json_decode('{"segment_id": 1}'); -$segment_id = "test_url_param"; -$response = $sg->client->contactdb()->segments()->_($segment_id)->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a segment # -// DELETE /contactdb/segments/{segment_id} # - -$query_params = json_decode('{"delete_contacts": "true"}'); -$segment_id = "test_url_param"; -$response = $sg->client->contactdb()->segments()->_($segment_id)->delete(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve recipients on a segment # -// GET /contactdb/segments/{segment_id}/recipients # - -$query_params = json_decode('{"page": 1, "page_size": 1}'); -$segment_id = "test_url_param"; -$response = $sg->client->contactdb()->segments()->_($segment_id)->recipients()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/devices/devices.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/devices/devices.php deleted file mode 100644 index 8204b16..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/devices/devices.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Retrieve email statistics by device type. # -// GET /devices/stats # - -$query_params = json_decode('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}'); -$response = $sg->client->devices()->stats()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/geo/geo.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/geo/geo.php deleted file mode 100644 index 8c4c152..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/geo/geo.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Retrieve email statistics by country and state/province. # -// GET /geo/stats # - -$query_params = json_decode('{"end_date": "2016-04-01", "country": "US", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01"}'); -$response = $sg->client->geo()->stats()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/helpers/mail/example.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/helpers/mail/example.php deleted file mode 100644 index 4c29bcf..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/helpers/mail/example.php +++ /dev/null @@ -1,201 +0,0 @@ -<?php -namespace SendGrid; - -// If you are using Composer -require __DIR__ . '<PATH_TO>/vendor/autoload.php'; - - -function helloEmail() -{ - $from = new Email(null, "test@example.com"); - $subject = "Hello World from the SendGrid PHP Library"; - $to = new Email(null, "test@example.com"); - $content = new Content("text/plain", "some text here"); - $mail = new Mail($from, $subject, $to, $content); - $to = new Email(null, "test2@example.com"); - $mail->personalization[0]->addTo($to); - - //echo json_encode($mail, JSON_PRETTY_PRINT), "\n"; - return $mail; -} - -function kitchenSink() -{ - $from = new Email("DX", "test@example.com"); - $subject = "Hello World from the SendGrid PHP Library"; - $to = new Email("Example User", "test1@example.com"); - $content = new Content("text/plain", "some text here"); - - $mail = new Mail($from, $subject, $to, $content); - - $email2 = new Email("Example User", "test2@example.com"); - $mail->personalization[0]->addTo($email2); - $email3 = new Email("Example User", "test3@example.com"); - $mail->personalization[0]->addCc($email3); - $email4 = new Email("Example User", "test4@example.com"); - $mail->personalization[0]->addCc($email4); - $email5 = new Email("Example User", "test5@example.com"); - $mail->personalization[0]->addBcc($email5); - $email6 = new Email("Example User", "test6@example.com"); - $mail->personalization[0]->addBcc($email6); - $mail->personalization[0]->setSubject("Hello World from the SendGrid PHP Library"); - $mail->personalization[0]->addHeader("X-Test", "test"); - $mail->personalization[0]->addHeader("X-Mock", "true"); - $mail->personalization[0]->addSubstitution("%name%", "Example User"); - $mail->personalization[0]->addSubstitution("%city%", "Denver"); - $mail->personalization[0]->addCustomArg("user_id", "343"); - $mail->personalization[0]->addCustomArg("type", "marketing"); - $mail->personalization[0]->setSendAt(1443636843); - - $personalization1 = new Personalization(); - $email7 = new Email("Example User", "test7@example.com"); - $personalization1->addTo($email7); - $email8 = new Email("Example User", "test8@example.com"); - $personalization1->addTo($email8); - $email9 = new Email("Example User", "test9@example.com"); - $personalization1->addCc($email9); - $email10 = new Email("Example User", "test10@example.com"); - $personalization1->addCc($email10); - $email11 = new Email("Example User", "test11@example.com"); - $personalization1->addBcc($email11); - $email12 = new Email("Example User", "test12@example.com"); - $personalization1->addBcc($email12); - $personalization1->setSubject("Hello World from the SendGrid PHP Library"); - $personalization1->addHeader("X-Test", "test"); - $personalization1->addHeader("X-Mock", "true"); - $personalization1->addSubstitution("%name%", "Example User"); - $personalization1->addSubstitution("%city%", "Denver"); - $personalization1->addCustomArg("user_id", "343"); - $personalization1->addCustomArg("type", "marketing"); - $personalization1->setSendAt(1443636843); - $mail->addPersonalization($personalization1); - - $content = new Content("text/html", "<html><body>some text here</body></html>"); - $mail->addContent($content); - - $attachment = new Attachment(); - $attachment->setContent("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12"); - $attachment->setType("application/pdf"); - $attachment->setFilename("balance_001.pdf"); - $attachment->setDisposition("attachment"); - $attachment->setContentId("Balance Sheet"); - $mail->addAttachment($attachment); - - $attachment2 = new Attachment(); - $attachment2->setContent("BwdW"); - $attachment2->setType("image/png"); - $attachment2->setFilename("banner.png"); - $attachment2->setDisposition("inline"); - $attachment2->setContentId("Banner"); - $mail->addAttachment($attachment2); - - $mail->setTemplateId("439b6d66-4408-4ead-83de-5c83c2ee313a"); - - # This must be a valid [batch ID](https://sendgrid.com/docs/API_Reference/SMTP_API/scheduling_parameters.html) to work - # $mail->setBatchID("sengrid_batch_id"); - - $mail->addSection("%section1%", "Substitution Text for Section 1"); - $mail->addSection("%section2%", "Substitution Text for Section 2"); - - $mail->addHeader("X-Test1", "1"); - $mail->addHeader("X-Test2", "2"); - - $mail->addCategory("May"); - $mail->addCategory("2016"); - - $mail->addCustomArg("campaign", "welcome"); - $mail->addCustomArg("weekday", "morning"); - - $mail->setSendAt(1443636842); - - $asm = new ASM(); - $asm->setGroupId(99); - $asm->setGroupsToDisplay([4,5,6,7,8]); - $mail->setASM($asm); - - $mail->setIpPoolName("23"); - - $mail_settings = new MailSettings(); - $bcc_settings = new BccSettings(); - $bcc_settings->setEnable(true); - $bcc_settings->setEmail("test@example.com"); - $mail_settings->setBccSettings($bcc_settings); - $sandbox_mode = new SandBoxMode(); - $sandbox_mode->setEnable(true); - $mail_settings->setSandboxMode($sandbox_mode); - $bypass_list_management = new BypassListManagement(); - $bypass_list_management->setEnable(true); - $mail_settings->setBypassListManagement($bypass_list_management); - $footer = new Footer(); - $footer->setEnable(true); - $footer->setText("Footer Text"); - $footer->setHtml("<html><body>Footer Text</body></html>"); - $mail_settings->setFooter($footer); - $spam_check = new SpamCheck(); - $spam_check->setEnable(true); - $spam_check->setThreshold(1); - $spam_check->setPostToUrl("https://spamcatcher.sendgrid.com"); - $mail_settings->setSpamCheck($spam_check); - $mail->setMailSettings($mail_settings); - - $tracking_settings = new TrackingSettings(); - $click_tracking = new ClickTracking(); - $click_tracking->setEnable(true); - $click_tracking->setEnableText(true); - $tracking_settings->setClickTracking($click_tracking); - $open_tracking = new OpenTracking(); - $open_tracking->setEnable(true); - $open_tracking->setSubstitutionTag("Optional tag to replace with the open image in the body of the message"); - $tracking_settings->setOpenTracking($open_tracking); - $subscription_tracking = new SubscriptionTracking(); - $subscription_tracking->setEnable(true); - $subscription_tracking->setText("text to insert into the text/plain portion of the message"); - $subscription_tracking->setHtml("<html><body>html to insert into the text/html portion of the message</body></html>"); - $subscription_tracking->setSubstitutionTag("Optional tag to replace with the open image in the body of the message"); - $tracking_settings->setSubscriptionTracking($subscription_tracking); - $ganalytics = new Ganalytics(); - $ganalytics->setEnable(true); - $ganalytics->setCampaignSource("some source"); - $ganalytics->setCampaignTerm("some term"); - $ganalytics->setCampaignContent("some content"); - $ganalytics->setCampaignName("some name"); - $ganalytics->setCampaignMedium("some medium"); - $tracking_settings->setGanalytics($ganalytics); - $mail->setTrackingSettings($tracking_settings); - - $reply_to = new ReplyTo("test@example.com", "Optional Name"); - $mail->setReplyTo($reply_to); - - //echo json_encode($mail, JSON_PRETTY_PRINT), "\n"; - return $mail; -} - -function sendHelloEmail() -{ - $apiKey = getenv('SENDGRID_API_KEY'); - $sg = new \SendGrid($apiKey); - - $request_body = helloEmail(); - $response = $sg->client->mail()->send()->post($request_body); - echo $response->statusCode(); - echo $response->body(); - print_r($response->headers()); -} - -function sendKitchenSink() -{ - $apiKey = getenv('SENDGRID_API_KEY'); - $sg = new \SendGrid($apiKey); - - $request_body = kitchenSink(); - $response = $sg->client->mail()->send()->post($request_body); - echo $response->statusCode(); - echo $response->body(); - print_r($response->headers()); -} - -sendHelloEmail(); // this will actually send an email -sendKitchenSink(); // this will only send an email if you set SandBox Mode to false -?> - - diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/ips/ips.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/ips/ips.php deleted file mode 100644 index 4827955..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/ips/ips.php +++ /dev/null @@ -1,155 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Retrieve all IP addresses # -// GET /ips # - -$query_params = json_decode('{"subuser": "test_string", "ip": "test_string", "limit": 1, "exclude_whitelabels": "true", "offset": 1}'); -$response = $sg->client->ips()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all assigned IPs # -// GET /ips/assigned # - -$response = $sg->client->ips()->assigned()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Create an IP pool. # -// POST /ips/pools # - -$request_body = json_decode('{ - "name": "marketing" -}'); -$response = $sg->client->ips()->pools()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all IP pools. # -// GET /ips/pools # - -$response = $sg->client->ips()->pools()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update an IP pools name. # -// PUT /ips/pools/{pool_name} # - -$request_body = json_decode('{ - "name": "new_pool_name" -}'); -$pool_name = "test_url_param"; -$response = $sg->client->ips()->pools()->_($pool_name)->put($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all IPs in a specified pool. # -// GET /ips/pools/{pool_name} # - -$pool_name = "test_url_param"; -$response = $sg->client->ips()->pools()->_($pool_name)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete an IP pool. # -// DELETE /ips/pools/{pool_name} # - -$pool_name = "test_url_param"; -$response = $sg->client->ips()->pools()->_($pool_name)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Add an IP address to a pool # -// POST /ips/pools/{pool_name}/ips # - -$request_body = json_decode('{ - "ip": "0.0.0.0" -}'); -$pool_name = "test_url_param"; -$response = $sg->client->ips()->pools()->_($pool_name)->ips()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Remove an IP address from a pool. # -// DELETE /ips/pools/{pool_name}/ips/{ip} # - -$pool_name = "test_url_param"; -$ip = "test_url_param"; -$response = $sg->client->ips()->pools()->_($pool_name)->ips()->_($ip)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Add an IP to warmup # -// POST /ips/warmup # - -$request_body = json_decode('{ - "ip": "0.0.0.0" -}'); -$response = $sg->client->ips()->warmup()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all IPs currently in warmup # -// GET /ips/warmup # - -$response = $sg->client->ips()->warmup()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve warmup status for a specific IP address # -// GET /ips/warmup/{ip_address} # - -$ip_address = "test_url_param"; -$response = $sg->client->ips()->warmup()->_($ip_address)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Remove an IP from warmup # -// DELETE /ips/warmup/{ip_address} # - -$ip_address = "test_url_param"; -$response = $sg->client->ips()->warmup()->_($ip_address)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all IP pools an IP address belongs to # -// GET /ips/{ip_address} # - -$ip_address = "test_url_param"; -$response = $sg->client->ips()->_($ip_address)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/mail/mail.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/mail/mail.php deleted file mode 100644 index 69600ff..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/mail/mail.php +++ /dev/null @@ -1,174 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Create a batch ID # -// POST /mail/batch # - -$response = $sg->client->mail()->batch()->post(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Validate batch ID # -// GET /mail/batch/{batch_id} # - -$batch_id = "test_url_param"; -$response = $sg->client->mail()->batch()->_($batch_id)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// v3 Mail Send # -// POST /mail/send # -// This endpoint has a helper, check it out [here](https://github.com/sendgrid/sendgrid-php/blob/master/lib/helpers/mail/README.md). - -$request_body = json_decode('{ - "asm": { - "group_id": 1, - "groups_to_display": [ - 1, - 2, - 3 - ] - }, - "attachments": [ - { - "content": "[BASE64 encoded content block here]", - "content_id": "ii_139db99fdb5c3704", - "disposition": "inline", - "filename": "file1.jpg", - "name": "file1", - "type": "jpg" - } - ], - "batch_id": "[YOUR BATCH ID GOES HERE]", - "categories": [ - "category1", - "category2" - ], - "content": [ - { - "type": "text/html", - "value": "<html><p>Hello, world!</p><img src=[CID GOES HERE]></img></html>" - } - ], - "custom_args": { - "New Argument 1": "New Value 1", - "activationAttempt": "1", - "customerAccountNumber": "[CUSTOMER ACCOUNT NUMBER GOES HERE]" - }, - "from": { - "email": "sam.smith@example.com", - "name": "Sam Smith" - }, - "headers": {}, - "ip_pool_name": "[YOUR POOL NAME GOES HERE]", - "mail_settings": { - "bcc": { - "email": "ben.doe@example.com", - "enable": true - }, - "bypass_list_management": { - "enable": true - }, - "footer": { - "enable": true, - "html": "<p>Thanks</br>The SendGrid Team</p>", - "text": "Thanks,/n The SendGrid Team" - }, - "sandbox_mode": { - "enable": false - }, - "spam_check": { - "enable": true, - "post_to_url": "http://example.com/compliance", - "threshold": 3 - } - }, - "personalizations": [ - { - "bcc": [ - { - "email": "sam.doe@example.com", - "name": "Sam Doe" - } - ], - "cc": [ - { - "email": "jane.doe@example.com", - "name": "Jane Doe" - } - ], - "custom_args": { - "New Argument 1": "New Value 1", - "activationAttempt": "1", - "customerAccountNumber": "[CUSTOMER ACCOUNT NUMBER GOES HERE]" - }, - "headers": { - "X-Accept-Language": "en", - "X-Mailer": "MyApp" - }, - "send_at": 1409348513, - "subject": "Hello, World!", - "substitutions": { - "id": "substitutions", - "type": "object" - }, - "to": [ - { - "email": "john.doe@example.com", - "name": "John Doe" - } - ] - } - ], - "reply_to": { - "email": "sam.smith@example.com", - "name": "Sam Smith" - }, - "sections": { - "section": { - ":sectionName1": "section 1 text", - ":sectionName2": "section 2 text" - } - }, - "send_at": 1409348513, - "subject": "Hello, World!", - "template_id": "[YOUR TEMPLATE ID GOES HERE]", - "tracking_settings": { - "click_tracking": { - "enable": true, - "enable_text": true - }, - "ganalytics": { - "enable": true, - "utm_campaign": "[NAME OF YOUR REFERRER SOURCE]", - "utm_content": "[USE THIS SPACE TO DIFFERENTIATE YOUR EMAIL FROM ADS]", - "utm_medium": "[NAME OF YOUR MARKETING MEDIUM e.g. email]", - "utm_name": "[NAME OF YOUR CAMPAIGN]", - "utm_term": "[IDENTIFY PAID KEYWORDS HERE]" - }, - "open_tracking": { - "enable": true, - "substitution_tag": "%opentrack" - }, - "subscription_tracking": { - "enable": true, - "html": "If you would like to unsubscribe and stop receiving these emails <% clickhere %>.", - "substitution_tag": "<%click here%>", - "text": "If you would like to unsubscribe and stop receiveing these emails <% click here %>." - } - } -}'); -$response = $sg->client->mail()->send()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/mailboxproviders/mailboxproviders.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/mailboxproviders/mailboxproviders.php deleted file mode 100644 index 108eecf..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/mailboxproviders/mailboxproviders.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Retrieve email statistics by mailbox provider. # -// GET /mailbox_providers/stats # - -$query_params = json_decode('{"end_date": "2016-04-01", "mailbox_providers": "test_string", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01"}'); -$response = $sg->client->mailbox_providers()->stats()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/mailsettings/mailsettings.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/mailsettings/mailsettings.php deleted file mode 100644 index bd3cdc8..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/mailsettings/mailsettings.php +++ /dev/null @@ -1,220 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Retrieve all mail settings # -// GET /mail_settings # - -$query_params = json_decode('{"limit": 1, "offset": 1}'); -$response = $sg->client->mail_settings()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update address whitelist mail settings # -// PATCH /mail_settings/address_whitelist # - -$request_body = json_decode('{ - "enabled": true, - "list": [ - "email1@example.com", - "example.com" - ] -}'); -$response = $sg->client->mail_settings()->address_whitelist()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve address whitelist mail settings # -// GET /mail_settings/address_whitelist # - -$response = $sg->client->mail_settings()->address_whitelist()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update BCC mail settings # -// PATCH /mail_settings/bcc # - -$request_body = json_decode('{ - "email": "email@example.com", - "enabled": false -}'); -$response = $sg->client->mail_settings()->bcc()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all BCC mail settings # -// GET /mail_settings/bcc # - -$response = $sg->client->mail_settings()->bcc()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update bounce purge mail settings # -// PATCH /mail_settings/bounce_purge # - -$request_body = json_decode('{ - "enabled": true, - "hard_bounces": 5, - "soft_bounces": 5 -}'); -$response = $sg->client->mail_settings()->bounce_purge()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve bounce purge mail settings # -// GET /mail_settings/bounce_purge # - -$response = $sg->client->mail_settings()->bounce_purge()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update footer mail settings # -// PATCH /mail_settings/footer # - -$request_body = json_decode('{ - "enabled": true, - "html_content": "...", - "plain_content": "..." -}'); -$response = $sg->client->mail_settings()->footer()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve footer mail settings # -// GET /mail_settings/footer # - -$response = $sg->client->mail_settings()->footer()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update forward bounce mail settings # -// PATCH /mail_settings/forward_bounce # - -$request_body = json_decode('{ - "email": "example@example.com", - "enabled": true -}'); -$response = $sg->client->mail_settings()->forward_bounce()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve forward bounce mail settings # -// GET /mail_settings/forward_bounce # - -$response = $sg->client->mail_settings()->forward_bounce()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update forward spam mail settings # -// PATCH /mail_settings/forward_spam # - -$request_body = json_decode('{ - "email": "", - "enabled": false -}'); -$response = $sg->client->mail_settings()->forward_spam()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve forward spam mail settings # -// GET /mail_settings/forward_spam # - -$response = $sg->client->mail_settings()->forward_spam()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update plain content mail settings # -// PATCH /mail_settings/plain_content # - -$request_body = json_decode('{ - "enabled": false -}'); -$response = $sg->client->mail_settings()->plain_content()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve plain content mail settings # -// GET /mail_settings/plain_content # - -$response = $sg->client->mail_settings()->plain_content()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update spam check mail settings # -// PATCH /mail_settings/spam_check # - -$request_body = json_decode('{ - "enabled": true, - "max_score": 5, - "url": "url" -}'); -$response = $sg->client->mail_settings()->spam_check()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve spam check mail settings # -// GET /mail_settings/spam_check # - -$response = $sg->client->mail_settings()->spam_check()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update template mail settings # -// PATCH /mail_settings/template # - -$request_body = json_decode('{ - "enabled": true, - "html_content": "<% body %>" -}'); -$response = $sg->client->mail_settings()->template()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve legacy template mail settings # -// GET /mail_settings/template # - -$response = $sg->client->mail_settings()->template()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/partnersettings/partnersettings.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/partnersettings/partnersettings.php deleted file mode 100644 index b214f0a..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/partnersettings/partnersettings.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Returns a list of all partner settings. # -// GET /partner_settings # - -$query_params = json_decode('{"limit": 1, "offset": 1}'); -$response = $sg->client->partner_settings()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Updates New Relic partner settings. # -// PATCH /partner_settings/new_relic # - -$request_body = json_decode('{ - "enable_subuser_statistics": true, - "enabled": true, - "license_key": "" -}'); -$response = $sg->client->partner_settings()->new_relic()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Returns all New Relic partner settings. # -// GET /partner_settings/new_relic # - -$response = $sg->client->partner_settings()->new_relic()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/scopes/scopes.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/scopes/scopes.php deleted file mode 100644 index c9776df..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/scopes/scopes.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Retrieve a list of scopes for which this user has access. # -// GET /scopes # - -$response = $sg->client->scopes()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/senders/senders.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/senders/senders.php deleted file mode 100644 index c75d787..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/senders/senders.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Create a Sender Identity # -// POST /senders # - -$request_body = json_decode('{ - "address": "123 Elm St.", - "address_2": "Apt. 456", - "city": "Denver", - "country": "United States", - "from": { - "email": "from@example.com", - "name": "Example INC" - }, - "nickname": "My Sender ID", - "reply_to": { - "email": "replyto@example.com", - "name": "Example INC" - }, - "state": "Colorado", - "zip": "80202" -}'); -$response = $sg->client->senders()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Get all Sender Identities # -// GET /senders # - -$response = $sg->client->senders()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update a Sender Identity # -// PATCH /senders/{sender_id} # - -$request_body = json_decode('{ - "address": "123 Elm St.", - "address_2": "Apt. 456", - "city": "Denver", - "country": "United States", - "from": { - "email": "from@example.com", - "name": "Example INC" - }, - "nickname": "My Sender ID", - "reply_to": { - "email": "replyto@example.com", - "name": "Example INC" - }, - "state": "Colorado", - "zip": "80202" -}'); -$sender_id = "test_url_param"; -$response = $sg->client->senders()->_($sender_id)->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// View a Sender Identity # -// GET /senders/{sender_id} # - -$sender_id = "test_url_param"; -$response = $sg->client->senders()->_($sender_id)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a Sender Identity # -// DELETE /senders/{sender_id} # - -$sender_id = "test_url_param"; -$response = $sg->client->senders()->_($sender_id)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Resend Sender Identity Verification # -// POST /senders/{sender_id}/resend_verification # - -$sender_id = "test_url_param"; -$response = $sg->client->senders()->_($sender_id)->resend_verification()->post(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/stats/stats.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/stats/stats.php deleted file mode 100644 index 795c016..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/stats/stats.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Retrieve global email statistics # -// GET /stats # - -$query_params = json_decode('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}'); -$response = $sg->client->stats()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/subusers/subusers.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/subusers/subusers.php deleted file mode 100644 index 0e96f8b..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/subusers/subusers.php +++ /dev/null @@ -1,170 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Create Subuser # -// POST /subusers # - -$request_body = json_decode('{ - "email": "John@example.com", - "ips": [ - "1.1.1.1", - "2.2.2.2" - ], - "password": "johns_password", - "username": "John@example.com" -}'); -$response = $sg->client->subusers()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// List all Subusers # -// GET /subusers # - -$query_params = json_decode('{"username": "test_string", "limit": 1, "offset": 1}'); -$response = $sg->client->subusers()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve Subuser Reputations # -// GET /subusers/reputations # - -$query_params = json_decode('{"usernames": "test_string"}'); -$response = $sg->client->subusers()->reputations()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve email statistics for your subusers. # -// GET /subusers/stats # - -$query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "subusers": "test_string"}'); -$response = $sg->client->subusers()->stats()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve monthly stats for all subusers # -// GET /subusers/stats/monthly # - -$query_params = json_decode('{"subuser": "test_string", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "date": "test_string", "sort_by_direction": "asc"}'); -$response = $sg->client->subusers()->stats()->monthly()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve the totals for each email statistic metric for all subusers. # -// GET /subusers/stats/sums # - -$query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "start_date": "2016-01-01", "sort_by_direction": "asc"}'); -$response = $sg->client->subusers()->stats()->sums()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Enable/disable a subuser # -// PATCH /subusers/{subuser_name} # - -$request_body = json_decode('{ - "disabled": false -}'); -$subuser_name = "test_url_param"; -$response = $sg->client->subusers()->_($subuser_name)->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a subuser # -// DELETE /subusers/{subuser_name} # - -$subuser_name = "test_url_param"; -$response = $sg->client->subusers()->_($subuser_name)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update IPs assigned to a subuser # -// PUT /subusers/{subuser_name}/ips # - -$request_body = json_decode('[ - "127.0.0.1" -]'); -$subuser_name = "test_url_param"; -$response = $sg->client->subusers()->_($subuser_name)->ips()->put($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update Monitor Settings for a subuser # -// PUT /subusers/{subuser_name}/monitor # - -$request_body = json_decode('{ - "email": "example@example.com", - "frequency": 500 -}'); -$subuser_name = "test_url_param"; -$response = $sg->client->subusers()->_($subuser_name)->monitor()->put($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Create monitor settings # -// POST /subusers/{subuser_name}/monitor # - -$request_body = json_decode('{ - "email": "example@example.com", - "frequency": 50000 -}'); -$subuser_name = "test_url_param"; -$response = $sg->client->subusers()->_($subuser_name)->monitor()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve monitor settings for a subuser # -// GET /subusers/{subuser_name}/monitor # - -$subuser_name = "test_url_param"; -$response = $sg->client->subusers()->_($subuser_name)->monitor()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete monitor settings # -// DELETE /subusers/{subuser_name}/monitor # - -$subuser_name = "test_url_param"; -$response = $sg->client->subusers()->_($subuser_name)->monitor()->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve the monthly email statistics for a single subuser # -// GET /subusers/{subuser_name}/stats/monthly # - -$query_params = json_decode('{"date": "test_string", "sort_by_direction": "asc", "limit": 1, "sort_by_metric": "test_string", "offset": 1}'); -$subuser_name = "test_url_param"; -$response = $sg->client->subusers()->_($subuser_name)->stats()->monthly()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/suppression/suppression.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/suppression/suppression.php deleted file mode 100644 index 9b40e37..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/suppression/suppression.php +++ /dev/null @@ -1,202 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Retrieve all blocks # -// GET /suppression/blocks # - -$query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}'); -$response = $sg->client->suppression()->blocks()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete blocks # -// DELETE /suppression/blocks # - -$request_body = json_decode('{ - "delete_all": false, - "emails": [ - "example1@example.com", - "example2@example.com" - ] -}'); -$response = $sg->client->suppression()->blocks()->delete($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a specific block # -// GET /suppression/blocks/{email} # - -$email = "test_url_param"; -$response = $sg->client->suppression()->blocks()->_($email)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a specific block # -// DELETE /suppression/blocks/{email} # - -$email = "test_url_param"; -$response = $sg->client->suppression()->blocks()->_($email)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all bounces # -// GET /suppression/bounces # - -$query_params = json_decode('{"start_time": 1, "end_time": 1}'); -$response = $sg->client->suppression()->bounces()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete bounces # -// DELETE /suppression/bounces # - -$request_body = json_decode('{ - "delete_all": true, - "emails": [ - "example@example.com", - "example2@example.com" - ] -}'); -$response = $sg->client->suppression()->bounces()->delete($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a Bounce # -// GET /suppression/bounces/{email} # - -$email = "test_url_param"; -$response = $sg->client->suppression()->bounces()->_($email)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a bounce # -// DELETE /suppression/bounces/{email} # - -$query_params = json_decode('{"email_address": "example@example.com"}'); -$email = "test_url_param"; -$response = $sg->client->suppression()->bounces()->_($email)->delete(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all invalid emails # -// GET /suppression/invalid_emails # - -$query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}'); -$response = $sg->client->suppression()->invalid_emails()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete invalid emails # -// DELETE /suppression/invalid_emails # - -$request_body = json_decode('{ - "delete_all": false, - "emails": [ - "example1@example.com", - "example2@example.com" - ] -}'); -$response = $sg->client->suppression()->invalid_emails()->delete($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a specific invalid email # -// GET /suppression/invalid_emails/{email} # - -$email = "test_url_param"; -$response = $sg->client->suppression()->invalid_emails()->_($email)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a specific invalid email # -// DELETE /suppression/invalid_emails/{email} # - -$email = "test_url_param"; -$response = $sg->client->suppression()->invalid_emails()->_($email)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a specific spam report # -// GET /suppression/spam_report/{email} # - -$email = "test_url_param"; -$response = $sg->client->suppression()->spam_report()->_($email)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a specific spam report # -// DELETE /suppression/spam_report/{email} # - -$email = "test_url_param"; -$response = $sg->client->suppression()->spam_report()->_($email)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all spam reports # -// GET /suppression/spam_reports # - -$query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}'); -$response = $sg->client->suppression()->spam_reports()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete spam reports # -// DELETE /suppression/spam_reports # - -$request_body = json_decode('{ - "delete_all": false, - "emails": [ - "example1@example.com", - "example2@example.com" - ] -}'); -$response = $sg->client->suppression()->spam_reports()->delete($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all global suppressions # -// GET /suppression/unsubscribes # - -$query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}'); -$response = $sg->client->suppression()->unsubscribes()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/templates/templates.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/templates/templates.php deleted file mode 100644 index e7d82bd..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/templates/templates.php +++ /dev/null @@ -1,130 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Create a transactional template. # -// POST /templates # - -$request_body = json_decode('{ - "name": "example_name" -}'); -$response = $sg->client->templates()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all transactional templates. # -// GET /templates # - -$response = $sg->client->templates()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Edit a transactional template. # -// PATCH /templates/{template_id} # - -$request_body = json_decode('{ - "name": "new_example_name" -}'); -$template_id = "test_url_param"; -$response = $sg->client->templates()->_($template_id)->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a single transactional template. # -// GET /templates/{template_id} # - -$template_id = "test_url_param"; -$response = $sg->client->templates()->_($template_id)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a template. # -// DELETE /templates/{template_id} # - -$template_id = "test_url_param"; -$response = $sg->client->templates()->_($template_id)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Create a new transactional template version. # -// POST /templates/{template_id}/versions # - -$request_body = json_decode('{ - "active": 1, - "html_content": "<%body%>", - "name": "example_version_name", - "plain_content": "<%body%>", - "subject": "<%subject%>", - "template_id": "ddb96bbc-9b92-425e-8979-99464621b543" -}'); -$template_id = "test_url_param"; -$response = $sg->client->templates()->_($template_id)->versions()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Edit a transactional template version. # -// PATCH /templates/{template_id}/versions/{version_id} # - -$request_body = json_decode('{ - "active": 1, - "html_content": "<%body%>", - "name": "updated_example_name", - "plain_content": "<%body%>", - "subject": "<%subject%>" -}'); -$template_id = "test_url_param"; -$version_id = "test_url_param"; -$response = $sg->client->templates()->_($template_id)->versions()->_($version_id)->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a specific transactional template version. # -// GET /templates/{template_id}/versions/{version_id} # - -$template_id = "test_url_param"; -$version_id = "test_url_param"; -$response = $sg->client->templates()->_($template_id)->versions()->_($version_id)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a transactional template version. # -// DELETE /templates/{template_id}/versions/{version_id} # - -$template_id = "test_url_param"; -$version_id = "test_url_param"; -$response = $sg->client->templates()->_($template_id)->versions()->_($version_id)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Activate a transactional template version. # -// POST /templates/{template_id}/versions/{version_id}/activate # - -$template_id = "test_url_param"; -$version_id = "test_url_param"; -$response = $sg->client->templates()->_($template_id)->versions()->_($version_id)->activate()->post(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/trackingsettings/trackingsettings.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/trackingsettings/trackingsettings.php deleted file mode 100644 index 851966f..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/trackingsettings/trackingsettings.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Retrieve Tracking Settings # -// GET /tracking_settings # - -$query_params = json_decode('{"limit": 1, "offset": 1}'); -$response = $sg->client->tracking_settings()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update Click Tracking Settings # -// PATCH /tracking_settings/click # - -$request_body = json_decode('{ - "enabled": true -}'); -$response = $sg->client->tracking_settings()->click()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve Click Track Settings # -// GET /tracking_settings/click # - -$response = $sg->client->tracking_settings()->click()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update Google Analytics Settings # -// PATCH /tracking_settings/google_analytics # - -$request_body = json_decode('{ - "enabled": true, - "utm_campaign": "website", - "utm_content": "", - "utm_medium": "email", - "utm_source": "sendgrid.com", - "utm_term": "" -}'); -$response = $sg->client->tracking_settings()->google_analytics()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve Google Analytics Settings # -// GET /tracking_settings/google_analytics # - -$response = $sg->client->tracking_settings()->google_analytics()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update Open Tracking Settings # -// PATCH /tracking_settings/open # - -$request_body = json_decode('{ - "enabled": true -}'); -$response = $sg->client->tracking_settings()->open()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Get Open Tracking Settings # -// GET /tracking_settings/open # - -$response = $sg->client->tracking_settings()->open()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update Subscription Tracking Settings # -// PATCH /tracking_settings/subscription # - -$request_body = json_decode('{ - "enabled": true, - "html_content": "html content", - "landing": "landing page html", - "plain_content": "text content", - "replace": "replacement tag", - "url": "url" -}'); -$response = $sg->client->tracking_settings()->subscription()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve Subscription Tracking Settings # -// GET /tracking_settings/subscription # - -$response = $sg->client->tracking_settings()->subscription()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/user/user.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/user/user.php deleted file mode 100644 index fa275a0..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/user/user.php +++ /dev/null @@ -1,294 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Get a user's account information. # -// GET /user/account # - -$response = $sg->client->user()->account()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve your credit balance # -// GET /user/credits # - -$response = $sg->client->user()->credits()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update your account email address # -// PUT /user/email # - -$request_body = json_decode('{ - "email": "example@example.com" -}'); -$response = $sg->client->user()->email()->put($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve your account email address # -// GET /user/email # - -$response = $sg->client->user()->email()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update your password # -// PUT /user/password # - -$request_body = json_decode('{ - "new_password": "new_password", - "old_password": "old_password" -}'); -$response = $sg->client->user()->password()->put($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update a user's profile # -// PATCH /user/profile # - -$request_body = json_decode('{ - "city": "Orange", - "first_name": "Example", - "last_name": "User" -}'); -$response = $sg->client->user()->profile()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Get a user's profile # -// GET /user/profile # - -$response = $sg->client->user()->profile()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Cancel or pause a scheduled send # -// POST /user/scheduled_sends # - -$request_body = json_decode('{ - "batch_id": "YOUR_BATCH_ID", - "status": "pause" -}'); -$response = $sg->client->user()->scheduled_sends()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all scheduled sends # -// GET /user/scheduled_sends # - -$response = $sg->client->user()->scheduled_sends()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update user scheduled send information # -// PATCH /user/scheduled_sends/{batch_id} # - -$request_body = json_decode('{ - "status": "pause" -}'); -$batch_id = "test_url_param"; -$response = $sg->client->user()->scheduled_sends()->_($batch_id)->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve scheduled send # -// GET /user/scheduled_sends/{batch_id} # - -$batch_id = "test_url_param"; -$response = $sg->client->user()->scheduled_sends()->_($batch_id)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a cancellation or pause of a scheduled send # -// DELETE /user/scheduled_sends/{batch_id} # - -$batch_id = "test_url_param"; -$response = $sg->client->user()->scheduled_sends()->_($batch_id)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update Enforced TLS settings # -// PATCH /user/settings/enforced_tls # - -$request_body = json_decode('{ - "require_tls": true, - "require_valid_cert": false -}'); -$response = $sg->client->user()->settings()->enforced_tls()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve current Enforced TLS settings. # -// GET /user/settings/enforced_tls # - -$response = $sg->client->user()->settings()->enforced_tls()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update your username # -// PUT /user/username # - -$request_body = json_decode('{ - "username": "test_username" -}'); -$response = $sg->client->user()->username()->put($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve your username # -// GET /user/username # - -$response = $sg->client->user()->username()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update Event Notification Settings # -// PATCH /user/webhooks/event/settings # - -$request_body = json_decode('{ - "bounce": true, - "click": true, - "deferred": true, - "delivered": true, - "dropped": true, - "enabled": true, - "group_resubscribe": true, - "group_unsubscribe": true, - "open": true, - "processed": true, - "spam_report": true, - "unsubscribe": true, - "url": "url" -}'); -$response = $sg->client->user()->webhooks()->event()->settings()->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve Event Webhook settings # -// GET /user/webhooks/event/settings # - -$response = $sg->client->user()->webhooks()->event()->settings()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Test Event Notification Settings # -// POST /user/webhooks/event/test # - -$request_body = json_decode('{ - "url": "url" -}'); -$response = $sg->client->user()->webhooks()->event()->test()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Create a parse setting # -// POST /user/webhooks/parse/settings # - -$request_body = json_decode('{ - "hostname": "myhostname.com", - "send_raw": false, - "spam_check": true, - "url": "http://email.myhosthame.com" -}'); -$response = $sg->client->user()->webhooks()->parse()->settings()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all parse settings # -// GET /user/webhooks/parse/settings # - -$response = $sg->client->user()->webhooks()->parse()->settings()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update a parse setting # -// PATCH /user/webhooks/parse/settings/{hostname} # - -$request_body = json_decode('{ - "send_raw": true, - "spam_check": false, - "url": "http://newdomain.com/parse" -}'); -$hostname = "test_url_param"; -$response = $sg->client->user()->webhooks()->parse()->settings()->_($hostname)->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a specific parse setting # -// GET /user/webhooks/parse/settings/{hostname} # - -$hostname = "test_url_param"; -$response = $sg->client->user()->webhooks()->parse()->settings()->_($hostname)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a parse setting # -// DELETE /user/webhooks/parse/settings/{hostname} # - -$hostname = "test_url_param"; -$response = $sg->client->user()->webhooks()->parse()->settings()->_($hostname)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieves Inbound Parse Webhook statistics. # -// GET /user/webhooks/parse/stats # - -$query_params = json_decode('{"aggregated_by": "day", "limit": "test_string", "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": "test_string"}'); -$response = $sg->client->user()->webhooks()->parse()->stats()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/whitelabel/whitelabel.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/whitelabel/whitelabel.php deleted file mode 100644 index 18dcdf8..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/examples/whitelabel/whitelabel.php +++ /dev/null @@ -1,311 +0,0 @@ -<?php -// If you are using Composer -require 'vendor/autoload.php'; - - -$apiKey = getenv('SENDGRID_API_KEY'); -$sg = new \SendGrid($apiKey); - -//////////////////////////////////////////////////// -// Create a domain whitelabel. # -// POST /whitelabel/domains # - -$request_body = json_decode('{ - "automatic_security": false, - "custom_spf": true, - "default": true, - "domain": "example.com", - "ips": [ - "192.168.1.1", - "192.168.1.2" - ], - "subdomain": "news", - "username": "john@example.com" -}'); -$response = $sg->client->whitelabel()->domains()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// List all domain whitelabels. # -// GET /whitelabel/domains # - -$query_params = json_decode('{"username": "test_string", "domain": "test_string", "exclude_subusers": "true", "limit": 1, "offset": 1}'); -$response = $sg->client->whitelabel()->domains()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Get the default domain whitelabel. # -// GET /whitelabel/domains/default # - -$response = $sg->client->whitelabel()->domains()->default()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// List the domain whitelabel associated with the given user. # -// GET /whitelabel/domains/subuser # - -$response = $sg->client->whitelabel()->domains()->subuser()->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Disassociate a domain whitelabel from a given user. # -// DELETE /whitelabel/domains/subuser # - -$response = $sg->client->whitelabel()->domains()->subuser()->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update a domain whitelabel. # -// PATCH /whitelabel/domains/{domain_id} # - -$request_body = json_decode('{ - "custom_spf": true, - "default": false -}'); -$domain_id = "test_url_param"; -$response = $sg->client->whitelabel()->domains()->_($domain_id)->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a domain whitelabel. # -// GET /whitelabel/domains/{domain_id} # - -$domain_id = "test_url_param"; -$response = $sg->client->whitelabel()->domains()->_($domain_id)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a domain whitelabel. # -// DELETE /whitelabel/domains/{domain_id} # - -$domain_id = "test_url_param"; -$response = $sg->client->whitelabel()->domains()->_($domain_id)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Associate a domain whitelabel with a given user. # -// POST /whitelabel/domains/{domain_id}/subuser # - -$request_body = json_decode('{ - "username": "jane@example.com" -}'); -$domain_id = "test_url_param"; -$response = $sg->client->whitelabel()->domains()->_($domain_id)->subuser()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Add an IP to a domain whitelabel. # -// POST /whitelabel/domains/{id}/ips # - -$request_body = json_decode('{ - "ip": "192.168.0.1" -}'); -$id = "test_url_param"; -$response = $sg->client->whitelabel()->domains()->_($id)->ips()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Remove an IP from a domain whitelabel. # -// DELETE /whitelabel/domains/{id}/ips/{ip} # - -$id = "test_url_param"; -$ip = "test_url_param"; -$response = $sg->client->whitelabel()->domains()->_($id)->ips()->_($ip)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Validate a domain whitelabel. # -// POST /whitelabel/domains/{id}/validate # - -$id = "test_url_param"; -$response = $sg->client->whitelabel()->domains()->_($id)->validate()->post(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Create an IP whitelabel # -// POST /whitelabel/ips # - -$request_body = json_decode('{ - "domain": "example.com", - "ip": "192.168.1.1", - "subdomain": "email" -}'); -$response = $sg->client->whitelabel()->ips()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all IP whitelabels # -// GET /whitelabel/ips # - -$query_params = json_decode('{"ip": "test_string", "limit": 1, "offset": 1}'); -$response = $sg->client->whitelabel()->ips()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve an IP whitelabel # -// GET /whitelabel/ips/{id} # - -$id = "test_url_param"; -$response = $sg->client->whitelabel()->ips()->_($id)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete an IP whitelabel # -// DELETE /whitelabel/ips/{id} # - -$id = "test_url_param"; -$response = $sg->client->whitelabel()->ips()->_($id)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Validate an IP whitelabel # -// POST /whitelabel/ips/{id}/validate # - -$id = "test_url_param"; -$response = $sg->client->whitelabel()->ips()->_($id)->validate()->post(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Create a Link Whitelabel # -// POST /whitelabel/links # - -$request_body = json_decode('{ - "default": true, - "domain": "example.com", - "subdomain": "mail" -}'); -$query_params = json_decode('{"limit": 1, "offset": 1}'); -$response = $sg->client->whitelabel()->links()->post($request_body, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve all link whitelabels # -// GET /whitelabel/links # - -$query_params = json_decode('{"limit": 1}'); -$response = $sg->client->whitelabel()->links()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a Default Link Whitelabel # -// GET /whitelabel/links/default # - -$query_params = json_decode('{"domain": "test_string"}'); -$response = $sg->client->whitelabel()->links()->default()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve Associated Link Whitelabel # -// GET /whitelabel/links/subuser # - -$query_params = json_decode('{"username": "test_string"}'); -$response = $sg->client->whitelabel()->links()->subuser()->get(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Disassociate a Link Whitelabel # -// DELETE /whitelabel/links/subuser # - -$query_params = json_decode('{"username": "test_string"}'); -$response = $sg->client->whitelabel()->links()->subuser()->delete(null, $query_params); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Update a Link Whitelabel # -// PATCH /whitelabel/links/{id} # - -$request_body = json_decode('{ - "default": true -}'); -$id = "test_url_param"; -$response = $sg->client->whitelabel()->links()->_($id)->patch($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Retrieve a Link Whitelabel # -// GET /whitelabel/links/{id} # - -$id = "test_url_param"; -$response = $sg->client->whitelabel()->links()->_($id)->get(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Delete a Link Whitelabel # -// DELETE /whitelabel/links/{id} # - -$id = "test_url_param"; -$response = $sg->client->whitelabel()->links()->_($id)->delete(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Validate a Link Whitelabel # -// POST /whitelabel/links/{id}/validate # - -$id = "test_url_param"; -$response = $sg->client->whitelabel()->links()->_($id)->validate()->post(); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); - -//////////////////////////////////////////////////// -// Associate a Link Whitelabel # -// POST /whitelabel/links/{link_id}/subuser # - -$request_body = json_decode('{ - "username": "jane@example.com" -}'); -$link_id = "test_url_param"; -$response = $sg->client->whitelabel()->links()->_($link_id)->subuser()->post($request_body); -echo $response->statusCode(); -echo $response->body(); -print_r($response->headers()); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/prism.sh b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/prism.sh deleted file mode 100755 index 5d9d300..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/prism.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -install () { - -set -eu - -UNAME=$(uname) -ARCH=$(uname -m) -if [ "$UNAME" != "Linux" ] && [ "$UNAME" != "Darwin" ] && [ "$ARCH" != "x86_64" ] && [ "$ARCH" != "i686" ]; then - echo "Sorry, OS/Architecture not supported: ${UNAME}/${ARCH}. Download binary from https://github.com/stoplightio/prism/releases" - exit 1 -fi - -if [ "$UNAME" = "Darwin" ] ; then - OSX_ARCH=$(uname -m) - if [ "${OSX_ARCH}" = "x86_64" ] ; then - PLATFORM="darwin_amd64" - fi -elif [ "$UNAME" = "Linux" ] ; then - LINUX_ARCH=$(uname -m) - if [ "${LINUX_ARCH}" = "i686" ] ; then - PLATFORM="linux_386" - elif [ "${LINUX_ARCH}" = "x86_64" ] ; then - PLATFORM="linux_amd64" - fi -fi - -#LATEST=$(curl -s https://api.github.com/repos/stoplightio/prism/tags | grep -Eo '"name":.*?[^\\]",' | head -n 1 | sed 's/[," ]//g' | cut -d ':' -f 2) -LATEST="v0.1.5" -URL="https://github.com/stoplightio/prism/releases/download/$LATEST/prism_$PLATFORM" -DEST=./prism/bin/prism - -if [ -z $LATEST ] ; then - echo "Error requesting. Download binary from ${URL}" - exit 1 -else - curl -L $URL -o $DEST - chmod +x $DEST -fi -} - -install
\ No newline at end of file diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/unit/SendGridTest.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/unit/SendGridTest.php deleted file mode 100644 index ad340bf..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/unit/SendGridTest.php +++ /dev/null @@ -1,2498 +0,0 @@ -<?php -class SendGridTest_SendGrid extends \PHPUnit_Framework_TestCase -{ - protected static $apiKey; - protected static $sg; - protected static $pid; - - public static function setUpBeforeClass() - { - self::$apiKey = "SENDGRID_API_KEY"; - $host = array('host' => 'http://localhost:4010'); - self::$sg = new SendGrid(self::$apiKey, $host); - if (file_exists('/usr/local/bin/prism') == false) { - if (strtoupper(substr(php_uname('s'), 0, 3)) != 'WIN') { - try { - $proc_ls = proc_open("curl https://raw.githubusercontent.com/stoplightio/prism/master/install.sh", - array( - array("pipe","r"), //stdin - array("pipe","w"), //stdout - array("pipe","w") //stderr - ), - $pipes); - $output_ls = stream_get_contents($pipes[1]); - fclose($pipes[0]); - fclose($pipes[1]); - fclose($pipes[2]); - $return_value_ls = proc_close($proc_ls); - $proc_grep = proc_open("sh", - array( - array("pipe","r"), //stdin - array("pipe","w"), //stdout - array("pipe","w") //stderr - ), - $pipes); - - fwrite($pipes[0], $output_ls); - fclose($pipes[0]); - $output_grep = stream_get_contents($pipes[1]); - - fclose($pipes[1]); - fclose($pipes[2]); - proc_close($proc_grep); - } catch (Exception $e) { - print("Error downloading the prism binary, you can try downloading directly here (https://github.com/stoplightio/prism/releases) and place in your /usr/local/bin directory: " . $e->getMessage() . "\n"); - exit(); - } - } else { - print("Please download the Windows binary (https://github.com/stoplightio/prism/releases) and place it in your /usr/local/bin directory"); - exit(); - } - } - print("Activating Prism (~20 seconds)\n"); - $command = 'nohup prism run -s https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json > /dev/null 2>&1 & echo $!'; - exec($command, $op); - self::$pid = (int)$op[0]; - sleep(15); - print("\nPrism Started\n\n"); - } - - public function testHelloWorld() - { - $from = new SendGrid\Email("Example User", "test@example.com"); - $subject = "Sending with SendGrid is Fun"; - $to = new SendGrid\Email("Example User", "test@example.com"); - $content = new SendGrid\Content("text/plain", "and easy to do anywhere, even with PHP"); - $mail = new SendGrid\Mail($from, $subject, $to, $content); - $json = json_encode($mail->jsonSerialize()); - $this->assertEquals($json, '{"from":{"name":"Example User","email":"test@example.com"},"personalizations":[{"to":[{"name":"Example User","email":"test@example.com"}]}],"subject":"Sending with SendGrid is Fun","content":[{"type":"text\/plain","value":"and easy to do anywhere, even with PHP"}]}'); - } - - public function testVersion() - { - $this->assertEquals(SendGrid::VERSION, '6.0.0'); - $this->assertEquals(json_decode(file_get_contents(__DIR__ . '/../../composer.json'))->version, SendGrid::VERSION); - } - - public function testSendGrid() - { - $apiKey = 'SENDGRID_API_KEY'; - $sg = new SendGrid($apiKey); - $headers = array( - 'Authorization: Bearer '.$apiKey, - 'User-Agent: sendgrid/' . $sg->version . ';php', - 'Accept: application/json' - ); - - $this->assertEquals($sg->client->getHost(), 'https://api.sendgrid.com'); - $this->assertEquals($sg->client->getHeaders(), $headers); - $this->assertEquals($sg->client->getVersion(), '/v3'); - - $apiKey = 'SENDGRID_API_KEY'; - $sg2 = new SendGrid($apiKey, array('host' => 'https://api.test.com')); - $this->assertEquals($sg2->client->getHost(), 'https://api.test.com'); - - $sg3 = new SendGrid($apiKey, array('curl' => array('foo' => 'bar'))); - $this->assertEquals(array('foo' => 'bar'), $sg3->client->getCurlOptions()); - - $sg4 = new SendGrid($apiKey, ['curl' => [CURLOPT_PROXY => '127.0.0.1:8000']]); - $this->assertEquals($sg4->client->getCurlOptions(), [10004 => '127.0.0.1:8000']); - } - - public function test_access_settings_activity_get() - { - $query_params = json_decode('{"limit": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->access_settings()->activity()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_access_settings_whitelist_post() - { - $request_body = json_decode('{ - "ips": [ - { - "ip": "192.168.1.1" - }, - { - "ip": "192.*.*.*" - }, - { - "ip": "192.168.1.3/32" - } - ] -}'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->access_settings()->whitelist()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_access_settings_whitelist_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->access_settings()->whitelist()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_access_settings_whitelist_delete() - { - $request_body = json_decode('{ - "ids": [ - 1, - 2, - 3 - ] -}'); - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->access_settings()->whitelist()->delete($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_access_settings_whitelist__rule_id__get() - { - $rule_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->access_settings()->whitelist()->_($rule_id)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_access_settings_whitelist__rule_id__delete() - { - $rule_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->access_settings()->whitelist()->_($rule_id)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_alerts_post() - { - $request_body = json_decode('{ - "email_to": "example@example.com", - "frequency": "daily", - "type": "stats_notification" -}'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->alerts()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_alerts_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->alerts()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_alerts__alert_id__patch() - { - $request_body = json_decode('{ - "email_to": "example@example.com" -}'); - $alert_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->alerts()->_($alert_id)->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_alerts__alert_id__get() - { - $alert_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->alerts()->_($alert_id)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_alerts__alert_id__delete() - { - $alert_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->alerts()->_($alert_id)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_api_keys_post() - { - $request_body = json_decode('{ - "name": "My API Key", - "sample": "data", - "scopes": [ - "mail.send", - "alerts.create", - "alerts.read" - ] -}'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->api_keys()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_api_keys_get() - { - $query_params = json_decode('{"limit": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->api_keys()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_api_keys__api_key_id__put() - { - $request_body = json_decode('{ - "name": "A New Hope", - "scopes": [ - "user.profile.read", - "user.profile.update" - ] -}'); - $api_key_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->api_keys()->_($api_key_id)->put($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_api_keys__api_key_id__patch() - { - $request_body = json_decode('{ - "name": "A New Hope" -}'); - $api_key_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->api_keys()->_($api_key_id)->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_api_keys__api_key_id__get() - { - $api_key_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->api_keys()->_($api_key_id)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_api_keys__api_key_id__delete() - { - $api_key_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->api_keys()->_($api_key_id)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_asm_groups_post() - { - $request_body = json_decode('{ - "description": "Suggestions for products our users might like.", - "is_default": true, - "name": "Product Suggestions" -}'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->asm()->groups()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_asm_groups_get() - { - $query_params = json_decode('{"id": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->asm()->groups()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_asm_groups__group_id__patch() - { - $request_body = json_decode('{ - "description": "Suggestions for items our users might like.", - "id": 103, - "name": "Item Suggestions" -}'); - $group_id = "test_url_param"; - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->asm()->groups()->_($group_id)->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_asm_groups__group_id__get() - { - $group_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->asm()->groups()->_($group_id)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_asm_groups__group_id__delete() - { - $group_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->asm()->groups()->_($group_id)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_asm_groups__group_id__suppressions_post() - { - $request_body = json_decode('{ - "recipient_emails": [ - "test1@example.com", - "test2@example.com" - ] -}'); - $group_id = "test_url_param"; - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->asm()->groups()->_($group_id)->suppressions()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_asm_groups__group_id__suppressions_get() - { - $group_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->asm()->groups()->_($group_id)->suppressions()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_asm_groups__group_id__suppressions_search_post() - { - $request_body = json_decode('{ - "recipient_emails": [ - "exists1@example.com", - "exists2@example.com", - "doesnotexists@example.com" - ] -}'); - $group_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->asm()->groups()->_($group_id)->suppressions()->search()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_asm_groups__group_id__suppressions__email__delete() - { - $group_id = "test_url_param"; - $email = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->asm()->groups()->_($group_id)->suppressions()->_($email)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_asm_suppressions_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->asm()->suppressions()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_asm_suppressions_global_post() - { - $request_body = json_decode('{ - "recipient_emails": [ - "test1@example.com", - "test2@example.com" - ] -}'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->asm()->suppressions()->global()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_asm_suppressions_global__email__get() - { - $email = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->asm()->suppressions()->global()->_($email)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_asm_suppressions_global__email__delete() - { - $email = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->asm()->suppressions()->global()->_($email)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_asm_suppressions__email__get() - { - $email = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->asm()->suppressions()->_($email)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_browsers_stats_get() - { - $query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "browsers": "test_string", "limit": "test_string", "offset": "test_string", "start_date": "2016-01-01"}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->browsers()->stats()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_campaigns_post() - { - $request_body = json_decode('{ - "categories": [ - "spring line" - ], - "custom_unsubscribe_url": "", - "html_content": "<html><head><title></title></head><body><p>Check out our spring line!</p></body></html>", - "ip_pool": "marketing", - "list_ids": [ - 110, - 124 - ], - "plain_content": "Check out our spring line!", - "segment_ids": [ - 110 - ], - "sender_id": 124451, - "subject": "New Products for Spring!", - "suppression_group_id": 42, - "title": "March Newsletter" -}'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->campaigns()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_campaigns_get() - { - $query_params = json_decode('{"limit": 1, "offset": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->campaigns()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_campaigns__campaign_id__patch() - { - $request_body = json_decode('{ - "categories": [ - "summer line" - ], - "html_content": "<html><head><title></title></head><body><p>Check out our summer line!</p></body></html>", - "plain_content": "Check out our summer line!", - "subject": "New Products for Summer!", - "title": "May Newsletter" -}'); - $campaign_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->campaigns()->_($campaign_id)->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_campaigns__campaign_id__get() - { - $campaign_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->campaigns()->_($campaign_id)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_campaigns__campaign_id__delete() - { - $campaign_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->campaigns()->_($campaign_id)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_campaigns__campaign_id__schedules_patch() - { - $request_body = json_decode('{ - "send_at": 1489451436 -}'); - $campaign_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->campaigns()->_($campaign_id)->schedules()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_campaigns__campaign_id__schedules_post() - { - $request_body = json_decode('{ - "send_at": 1489771528 -}'); - $campaign_id = "test_url_param"; - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->campaigns()->_($campaign_id)->schedules()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_campaigns__campaign_id__schedules_get() - { - $campaign_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->campaigns()->_($campaign_id)->schedules()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_campaigns__campaign_id__schedules_delete() - { - $campaign_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->campaigns()->_($campaign_id)->schedules()->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_campaigns__campaign_id__schedules_now_post() - { - $campaign_id = "test_url_param"; - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->campaigns()->_($campaign_id)->schedules()->now()->post(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_campaigns__campaign_id__schedules_test_post() - { - $request_body = json_decode('{ - "to": "your.email@example.com" -}'); - $campaign_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->campaigns()->_($campaign_id)->schedules()->test()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_categories_get() - { - $query_params = json_decode('{"category": "test_string", "limit": 1, "offset": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->categories()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_categories_stats_get() - { - $query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "categories": "test_string"}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->categories()->stats()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_categories_stats_sums_get() - { - $query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "start_date": "2016-01-01", "sort_by_direction": "asc"}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->categories()->stats()->sums()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_clients_stats_get() - { - $query_params = json_decode('{"aggregated_by": "day", "start_date": "2016-01-01", "end_date": "2016-04-01"}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->clients()->stats()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_clients__client_type__stats_get() - { - $query_params = json_decode('{"aggregated_by": "day", "start_date": "2016-01-01", "end_date": "2016-04-01"}'); - $client_type = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->clients()->_($client_type)->stats()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_custom_fields_post() - { - $request_body = json_decode('{ - "name": "pet", - "type": "text" -}'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->contactdb()->custom_fields()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_contactdb_custom_fields_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->custom_fields()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_custom_fields__custom_field_id__get() - { - $custom_field_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->custom_fields()->_($custom_field_id)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_custom_fields__custom_field_id__delete() - { - $custom_field_id = "test_url_param"; - $request_headers = array("X-Mock: 202"); - $response = self::$sg->client->contactdb()->custom_fields()->_($custom_field_id)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 202); - } - - public function test_contactdb_lists_post() - { - $request_body = json_decode('{ - "name": "your list name" -}'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->contactdb()->lists()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_contactdb_lists_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->lists()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_lists_delete() - { - $request_body = json_decode('[ - 1, - 2, - 3, - 4 -]'); - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->contactdb()->lists()->delete($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_contactdb_lists__list_id__patch() - { - $request_body = json_decode('{ - "name": "newlistname" -}'); - $query_params = json_decode('{"list_id": 1}'); - $list_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->lists()->_($list_id)->patch($request_body, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_lists__list_id__get() - { - $query_params = json_decode('{"list_id": 1}'); - $list_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->lists()->_($list_id)->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_lists__list_id__delete() - { - $query_params = json_decode('{"delete_contacts": "true"}'); - $list_id = "test_url_param"; - $request_headers = array("X-Mock: 202"); - $response = self::$sg->client->contactdb()->lists()->_($list_id)->delete(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 202); - } - - public function test_contactdb_lists__list_id__recipients_post() - { - $request_body = json_decode('[ - "recipient_id1", - "recipient_id2" -]'); - $list_id = "test_url_param"; - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->contactdb()->lists()->_($list_id)->recipients()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_contactdb_lists__list_id__recipients_get() - { - $query_params = json_decode('{"page": 1, "page_size": 1, "list_id": 1}'); - $list_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->lists()->_($list_id)->recipients()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_lists__list_id__recipients__recipient_id__post() - { - $list_id = "test_url_param"; - $recipient_id = "test_url_param"; - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->contactdb()->lists()->_($list_id)->recipients()->_($recipient_id)->post(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_contactdb_lists__list_id__recipients__recipient_id__delete() - { - $query_params = json_decode('{"recipient_id": 1, "list_id": 1}'); - $list_id = "test_url_param"; - $recipient_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->contactdb()->lists()->_($list_id)->recipients()->_($recipient_id)->delete(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_contactdb_recipients_patch() - { - $request_body = json_decode('[ - { - "email": "jones@example.com", - "first_name": "Guy", - "last_name": "Jones" - } -]'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->contactdb()->recipients()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_contactdb_recipients_post() - { - $request_body = json_decode('[ - { - "age": 25, - "email": "example@example.com", - "first_name": "", - "last_name": "User" - }, - { - "age": 25, - "email": "example2@example.com", - "first_name": "Example", - "last_name": "User" - } -]'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->contactdb()->recipients()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_contactdb_recipients_get() - { - $query_params = json_decode('{"page": 1, "page_size": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->recipients()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_recipients_delete() - { - $request_body = json_decode('[ - "recipient_id1", - "recipient_id2" -]'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->recipients()->delete($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_recipients_billable_count_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->recipients()->billable_count()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_recipients_count_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->recipients()->count()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_recipients_search_get() - { - $query_params = json_decode('{"{field_name}": "test_string"}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->recipients()->search()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_recipients__recipient_id__get() - { - $recipient_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->recipients()->_($recipient_id)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_recipients__recipient_id__delete() - { - $recipient_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->contactdb()->recipients()->_($recipient_id)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_contactdb_recipients__recipient_id__lists_get() - { - $recipient_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->recipients()->_($recipient_id)->lists()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_reserved_fields_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->reserved_fields()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_segments_post() - { - $request_body = json_decode('{ - "conditions": [ - { - "and_or": "", - "field": "last_name", - "operator": "eq", - "value": "Miller" - }, - { - "and_or": "and", - "field": "last_clicked", - "operator": "gt", - "value": "01/02/2015" - }, - { - "and_or": "or", - "field": "clicks.campaign_identifier", - "operator": "eq", - "value": "513" - } - ], - "list_id": 4, - "name": "Last Name Miller" -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->segments()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_segments_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->segments()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_segments__segment_id__patch() - { - $request_body = json_decode('{ - "conditions": [ - { - "and_or": "", - "field": "last_name", - "operator": "eq", - "value": "Miller" - } - ], - "list_id": 5, - "name": "The Millers" -}'); - $query_params = json_decode('{"segment_id": "test_string"}'); - $segment_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->segments()->_($segment_id)->patch($request_body, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_segments__segment_id__get() - { - $query_params = json_decode('{"segment_id": 1}'); - $segment_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->segments()->_($segment_id)->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_contactdb_segments__segment_id__delete() - { - $query_params = json_decode('{"delete_contacts": "true"}'); - $segment_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->contactdb()->segments()->_($segment_id)->delete(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_contactdb_segments__segment_id__recipients_get() - { - $query_params = json_decode('{"page": 1, "page_size": 1}'); - $segment_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->contactdb()->segments()->_($segment_id)->recipients()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_devices_stats_get() - { - $query_params = json_decode('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->devices()->stats()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_geo_stats_get() - { - $query_params = json_decode('{"end_date": "2016-04-01", "country": "US", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01"}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->geo()->stats()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_ips_get() - { - $query_params = json_decode('{"subuser": "test_string", "ip": "test_string", "limit": 1, "exclude_whitelabels": "true", "offset": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->ips()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_ips_assigned_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->ips()->assigned()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_ips_pools_post() - { - $request_body = json_decode('{ - "name": "marketing" -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->ips()->pools()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_ips_pools_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->ips()->pools()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_ips_pools__pool_name__put() - { - $request_body = json_decode('{ - "name": "new_pool_name" -}'); - $pool_name = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->ips()->pools()->_($pool_name)->put($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_ips_pools__pool_name__get() - { - $pool_name = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->ips()->pools()->_($pool_name)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_ips_pools__pool_name__delete() - { - $pool_name = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->ips()->pools()->_($pool_name)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_ips_pools__pool_name__ips_post() - { - $request_body = json_decode('{ - "ip": "0.0.0.0" -}'); - $pool_name = "test_url_param"; - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->ips()->pools()->_($pool_name)->ips()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_ips_pools__pool_name__ips__ip__delete() - { - $pool_name = "test_url_param"; - $ip = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->ips()->pools()->_($pool_name)->ips()->_($ip)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_ips_warmup_post() - { - $request_body = json_decode('{ - "ip": "0.0.0.0" -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->ips()->warmup()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_ips_warmup_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->ips()->warmup()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_ips_warmup__ip_address__get() - { - $ip_address = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->ips()->warmup()->_($ip_address)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_ips_warmup__ip_address__delete() - { - $ip_address = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->ips()->warmup()->_($ip_address)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_ips__ip_address__get() - { - $ip_address = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->ips()->_($ip_address)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_batch_post() - { - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->mail()->batch()->post(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_mail_batch__batch_id__get() - { - $batch_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail()->batch()->_($batch_id)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_send_post() - { - $request_body = json_decode('{ - "asm": { - "group_id": 1, - "groups_to_display": [ - 1, - 2, - 3 - ] - }, - "attachments": [ - { - "content": "[BASE64 encoded content block here]", - "content_id": "ii_139db99fdb5c3704", - "disposition": "inline", - "filename": "file1.jpg", - "name": "file1", - "type": "jpg" - } - ], - "batch_id": "[YOUR BATCH ID GOES HERE]", - "categories": [ - "category1", - "category2" - ], - "content": [ - { - "type": "text/html", - "value": "<html><p>Hello, world!</p><img src=[CID GOES HERE]></img></html>" - } - ], - "custom_args": { - "New Argument 1": "New Value 1", - "activationAttempt": "1", - "customerAccountNumber": "[CUSTOMER ACCOUNT NUMBER GOES HERE]" - }, - "from": { - "email": "sam.smith@example.com", - "name": "Sam Smith" - }, - "headers": {}, - "ip_pool_name": "[YOUR POOL NAME GOES HERE]", - "mail_settings": { - "bcc": { - "email": "ben.doe@example.com", - "enable": true - }, - "bypass_list_management": { - "enable": true - }, - "footer": { - "enable": true, - "html": "<p>Thanks</br>The SendGrid Team</p>", - "text": "Thanks,/n The SendGrid Team" - }, - "sandbox_mode": { - "enable": false - }, - "spam_check": { - "enable": true, - "post_to_url": "http://example.com/compliance", - "threshold": 3 - } - }, - "personalizations": [ - { - "bcc": [ - { - "email": "sam.doe@example.com", - "name": "Sam Doe" - } - ], - "cc": [ - { - "email": "jane.doe@example.com", - "name": "Jane Doe" - } - ], - "custom_args": { - "New Argument 1": "New Value 1", - "activationAttempt": "1", - "customerAccountNumber": "[CUSTOMER ACCOUNT NUMBER GOES HERE]" - }, - "headers": { - "X-Accept-Language": "en", - "X-Mailer": "MyApp" - }, - "send_at": 1409348513, - "subject": "Hello, World!", - "substitutions": { - "id": "substitutions", - "type": "object" - }, - "to": [ - { - "email": "john.doe@example.com", - "name": "John Doe" - } - ] - } - ], - "reply_to": { - "email": "sam.smith@example.com", - "name": "Sam Smith" - }, - "sections": { - "section": { - ":sectionName1": "section 1 text", - ":sectionName2": "section 2 text" - } - }, - "send_at": 1409348513, - "subject": "Hello, World!", - "template_id": "[YOUR TEMPLATE ID GOES HERE]", - "tracking_settings": { - "click_tracking": { - "enable": true, - "enable_text": true - }, - "ganalytics": { - "enable": true, - "utm_campaign": "[NAME OF YOUR REFERRER SOURCE]", - "utm_content": "[USE THIS SPACE TO DIFFERENTIATE YOUR EMAIL FROM ADS]", - "utm_medium": "[NAME OF YOUR MARKETING MEDIUM e.g. email]", - "utm_name": "[NAME OF YOUR CAMPAIGN]", - "utm_term": "[IDENTIFY PAID KEYWORDS HERE]" - }, - "open_tracking": { - "enable": true, - "substitution_tag": "%opentrack" - }, - "subscription_tracking": { - "enable": true, - "html": "If you would like to unsubscribe and stop receiving these emails <% clickhere %>.", - "substitution_tag": "<%click here%>", - "text": "If you would like to unsubscribe and stop receiveing these emails <% click here %>." - } - } -}'); - $request_headers = array("X-Mock: 202"); - $response = self::$sg->client->mail()->send()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 202); - } - - public function test_mail_settings_get() - { - $query_params = json_decode('{"limit": 1, "offset": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_address_whitelist_patch() - { - $request_body = json_decode('{ - "enabled": true, - "list": [ - "email1@example.com", - "example.com" - ] -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->address_whitelist()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_address_whitelist_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->address_whitelist()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_bcc_patch() - { - $request_body = json_decode('{ - "email": "email@example.com", - "enabled": false -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->bcc()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_bcc_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->bcc()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_bounce_purge_patch() - { - $request_body = json_decode('{ - "enabled": true, - "hard_bounces": 5, - "soft_bounces": 5 -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->bounce_purge()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_bounce_purge_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->bounce_purge()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_footer_patch() - { - $request_body = json_decode('{ - "enabled": true, - "html_content": "...", - "plain_content": "..." -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->footer()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_footer_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->footer()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_forward_bounce_patch() - { - $request_body = json_decode('{ - "email": "example@example.com", - "enabled": true -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->forward_bounce()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_forward_bounce_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->forward_bounce()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_forward_spam_patch() - { - $request_body = json_decode('{ - "email": "", - "enabled": false -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->forward_spam()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_forward_spam_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->forward_spam()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_plain_content_patch() - { - $request_body = json_decode('{ - "enabled": false -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->plain_content()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_plain_content_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->plain_content()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_spam_check_patch() - { - $request_body = json_decode('{ - "enabled": true, - "max_score": 5, - "url": "url" -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->spam_check()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_spam_check_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->spam_check()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_template_patch() - { - $request_body = json_decode('{ - "enabled": true, - "html_content": "<% body %>" -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->template()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mail_settings_template_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mail_settings()->template()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_mailbox_providers_stats_get() - { - $query_params = json_decode('{"end_date": "2016-04-01", "mailbox_providers": "test_string", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01"}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->mailbox_providers()->stats()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_partner_settings_get() - { - $query_params = json_decode('{"limit": 1, "offset": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->partner_settings()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_partner_settings_new_relic_patch() - { - $request_body = json_decode('{ - "enable_subuser_statistics": true, - "enabled": true, - "license_key": "" -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->partner_settings()->new_relic()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_partner_settings_new_relic_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->partner_settings()->new_relic()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_scopes_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->scopes()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_senders_post() - { - $request_body = json_decode('{ - "address": "123 Elm St.", - "address_2": "Apt. 456", - "city": "Denver", - "country": "United States", - "from": { - "email": "from@example.com", - "name": "Example INC" - }, - "nickname": "My Sender ID", - "reply_to": { - "email": "replyto@example.com", - "name": "Example INC" - }, - "state": "Colorado", - "zip": "80202" -}'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->senders()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_senders_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->senders()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_senders__sender_id__patch() - { - $request_body = json_decode('{ - "address": "123 Elm St.", - "address_2": "Apt. 456", - "city": "Denver", - "country": "United States", - "from": { - "email": "from@example.com", - "name": "Example INC" - }, - "nickname": "My Sender ID", - "reply_to": { - "email": "replyto@example.com", - "name": "Example INC" - }, - "state": "Colorado", - "zip": "80202" -}'); - $sender_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->senders()->_($sender_id)->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_senders__sender_id__get() - { - $sender_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->senders()->_($sender_id)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_senders__sender_id__delete() - { - $sender_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->senders()->_($sender_id)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_senders__sender_id__resend_verification_post() - { - $sender_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->senders()->_($sender_id)->resend_verification()->post(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_stats_get() - { - $query_params = json_decode('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->stats()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_subusers_post() - { - $request_body = json_decode('{ - "email": "John@example.com", - "ips": [ - "1.1.1.1", - "2.2.2.2" - ], - "password": "johns_password", - "username": "John@example.com" -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->subusers()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_subusers_get() - { - $query_params = json_decode('{"username": "test_string", "limit": 1, "offset": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->subusers()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_subusers_reputations_get() - { - $query_params = json_decode('{"usernames": "test_string"}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->subusers()->reputations()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_subusers_stats_get() - { - $query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "subusers": "test_string"}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->subusers()->stats()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_subusers_stats_monthly_get() - { - $query_params = json_decode('{"subuser": "test_string", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "date": "test_string", "sort_by_direction": "asc"}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->subusers()->stats()->monthly()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_subusers_stats_sums_get() - { - $query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "start_date": "2016-01-01", "sort_by_direction": "asc"}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->subusers()->stats()->sums()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_subusers__subuser_name__patch() - { - $request_body = json_decode('{ - "disabled": false -}'); - $subuser_name = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->subusers()->_($subuser_name)->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_subusers__subuser_name__delete() - { - $subuser_name = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->subusers()->_($subuser_name)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_subusers__subuser_name__ips_put() - { - $request_body = json_decode('[ - "127.0.0.1" -]'); - $subuser_name = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->subusers()->_($subuser_name)->ips()->put($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_subusers__subuser_name__monitor_put() - { - $request_body = json_decode('{ - "email": "example@example.com", - "frequency": 500 -}'); - $subuser_name = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->subusers()->_($subuser_name)->monitor()->put($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_subusers__subuser_name__monitor_post() - { - $request_body = json_decode('{ - "email": "example@example.com", - "frequency": 50000 -}'); - $subuser_name = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->subusers()->_($subuser_name)->monitor()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_subusers__subuser_name__monitor_get() - { - $subuser_name = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->subusers()->_($subuser_name)->monitor()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_subusers__subuser_name__monitor_delete() - { - $subuser_name = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->subusers()->_($subuser_name)->monitor()->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_subusers__subuser_name__stats_monthly_get() - { - $query_params = json_decode('{"date": "test_string", "sort_by_direction": "asc", "limit": 1, "sort_by_metric": "test_string", "offset": 1}'); - $subuser_name = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->subusers()->_($subuser_name)->stats()->monthly()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_suppression_blocks_get() - { - $query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->suppression()->blocks()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_suppression_blocks_delete() - { - $request_body = json_decode('{ - "delete_all": false, - "emails": [ - "example1@example.com", - "example2@example.com" - ] -}'); - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->suppression()->blocks()->delete($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_suppression_blocks__email__get() - { - $email = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->suppression()->blocks()->_($email)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_suppression_blocks__email__delete() - { - $email = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->suppression()->blocks()->_($email)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_suppression_bounces_get() - { - $query_params = json_decode('{"start_time": 1, "end_time": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->suppression()->bounces()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_suppression_bounces_delete() - { - $request_body = json_decode('{ - "delete_all": true, - "emails": [ - "example@example.com", - "example2@example.com" - ] -}'); - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->suppression()->bounces()->delete($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_suppression_bounces__email__get() - { - $email = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->suppression()->bounces()->_($email)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_suppression_bounces__email__delete() - { - $query_params = json_decode('{"email_address": "example@example.com"}'); - $email = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->suppression()->bounces()->_($email)->delete(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_suppression_invalid_emails_get() - { - $query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->suppression()->invalid_emails()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_suppression_invalid_emails_delete() - { - $request_body = json_decode('{ - "delete_all": false, - "emails": [ - "example1@example.com", - "example2@example.com" - ] -}'); - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->suppression()->invalid_emails()->delete($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_suppression_invalid_emails__email__get() - { - $email = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->suppression()->invalid_emails()->_($email)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_suppression_invalid_emails__email__delete() - { - $email = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->suppression()->invalid_emails()->_($email)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_suppression_spam_report__email__get() - { - $email = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->suppression()->spam_report()->_($email)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_suppression_spam_report__email__delete() - { - $email = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->suppression()->spam_report()->_($email)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_suppression_spam_reports_get() - { - $query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->suppression()->spam_reports()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_suppression_spam_reports_delete() - { - $request_body = json_decode('{ - "delete_all": false, - "emails": [ - "example1@example.com", - "example2@example.com" - ] -}'); - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->suppression()->spam_reports()->delete($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_suppression_unsubscribes_get() - { - $query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->suppression()->unsubscribes()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_templates_post() - { - $request_body = json_decode('{ - "name": "example_name" -}'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->templates()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_templates_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->templates()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_templates__template_id__patch() - { - $request_body = json_decode('{ - "name": "new_example_name" -}'); - $template_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->templates()->_($template_id)->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_templates__template_id__get() - { - $template_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->templates()->_($template_id)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_templates__template_id__delete() - { - $template_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->templates()->_($template_id)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_templates__template_id__versions_post() - { - $request_body = json_decode('{ - "active": 1, - "html_content": "<%body%>", - "name": "example_version_name", - "plain_content": "<%body%>", - "subject": "<%subject%>", - "template_id": "ddb96bbc-9b92-425e-8979-99464621b543" -}'); - $template_id = "test_url_param"; - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->templates()->_($template_id)->versions()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_templates__template_id__versions__version_id__patch() - { - $request_body = json_decode('{ - "active": 1, - "html_content": "<%body%>", - "name": "updated_example_name", - "plain_content": "<%body%>", - "subject": "<%subject%>" -}'); - $template_id = "test_url_param"; - $version_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->templates()->_($template_id)->versions()->_($version_id)->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_templates__template_id__versions__version_id__get() - { - $template_id = "test_url_param"; - $version_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->templates()->_($template_id)->versions()->_($version_id)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_templates__template_id__versions__version_id__delete() - { - $template_id = "test_url_param"; - $version_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->templates()->_($template_id)->versions()->_($version_id)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_templates__template_id__versions__version_id__activate_post() - { - $template_id = "test_url_param"; - $version_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->templates()->_($template_id)->versions()->_($version_id)->activate()->post(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_tracking_settings_get() - { - $query_params = json_decode('{"limit": 1, "offset": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->tracking_settings()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_tracking_settings_click_patch() - { - $request_body = json_decode('{ - "enabled": true -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->tracking_settings()->click()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_tracking_settings_click_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->tracking_settings()->click()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_tracking_settings_google_analytics_patch() - { - $request_body = json_decode('{ - "enabled": true, - "utm_campaign": "website", - "utm_content": "", - "utm_medium": "email", - "utm_source": "sendgrid.com", - "utm_term": "" -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->tracking_settings()->google_analytics()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_tracking_settings_google_analytics_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->tracking_settings()->google_analytics()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_tracking_settings_open_patch() - { - $request_body = json_decode('{ - "enabled": true -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->tracking_settings()->open()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_tracking_settings_open_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->tracking_settings()->open()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_tracking_settings_subscription_patch() - { - $request_body = json_decode('{ - "enabled": true, - "html_content": "html content", - "landing": "landing page html", - "plain_content": "text content", - "replace": "replacement tag", - "url": "url" -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->tracking_settings()->subscription()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_tracking_settings_subscription_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->tracking_settings()->subscription()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_account_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->account()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_credits_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->credits()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_email_put() - { - $request_body = json_decode('{ - "email": "example@example.com" -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->email()->put($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_email_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->email()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_password_put() - { - $request_body = json_decode('{ - "new_password": "new_password", - "old_password": "old_password" -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->password()->put($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_profile_patch() - { - $request_body = json_decode('{ - "city": "Orange", - "first_name": "Example", - "last_name": "User" -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->profile()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_profile_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->profile()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_scheduled_sends_post() - { - $request_body = json_decode('{ - "batch_id": "YOUR_BATCH_ID", - "status": "pause" -}'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->user()->scheduled_sends()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_user_scheduled_sends_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->scheduled_sends()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_scheduled_sends__batch_id__patch() - { - $request_body = json_decode('{ - "status": "pause" -}'); - $batch_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->user()->scheduled_sends()->_($batch_id)->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_user_scheduled_sends__batch_id__get() - { - $batch_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->scheduled_sends()->_($batch_id)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_scheduled_sends__batch_id__delete() - { - $batch_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->user()->scheduled_sends()->_($batch_id)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_user_settings_enforced_tls_patch() - { - $request_body = json_decode('{ - "require_tls": true, - "require_valid_cert": false -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->settings()->enforced_tls()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_settings_enforced_tls_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->settings()->enforced_tls()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_username_put() - { - $request_body = json_decode('{ - "username": "test_username" -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->username()->put($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_username_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->username()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_webhooks_event_settings_patch() - { - $request_body = json_decode('{ - "bounce": true, - "click": true, - "deferred": true, - "delivered": true, - "dropped": true, - "enabled": true, - "group_resubscribe": true, - "group_unsubscribe": true, - "open": true, - "processed": true, - "spam_report": true, - "unsubscribe": true, - "url": "url" -}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->webhooks()->event()->settings()->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_webhooks_event_settings_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->webhooks()->event()->settings()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_webhooks_event_test_post() - { - $request_body = json_decode('{ - "url": "url" -}'); - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->user()->webhooks()->event()->test()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_user_webhooks_parse_settings_post() - { - $request_body = json_decode('{ - "hostname": "myhostname.com", - "send_raw": false, - "spam_check": true, - "url": "http://email.myhosthame.com" -}'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->user()->webhooks()->parse()->settings()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_user_webhooks_parse_settings_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->webhooks()->parse()->settings()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_webhooks_parse_settings__hostname__patch() - { - $request_body = json_decode('{ - "send_raw": true, - "spam_check": false, - "url": "http://newdomain.com/parse" -}'); - $hostname = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->webhooks()->parse()->settings()->_($hostname)->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_webhooks_parse_settings__hostname__get() - { - $hostname = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->webhooks()->parse()->settings()->_($hostname)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_user_webhooks_parse_settings__hostname__delete() - { - $hostname = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->user()->webhooks()->parse()->settings()->_($hostname)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_user_webhooks_parse_stats_get() - { - $query_params = json_decode('{"aggregated_by": "day", "limit": "test_string", "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": "test_string"}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->user()->webhooks()->parse()->stats()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_domains_post() - { - $request_body = json_decode('{ - "automatic_security": false, - "custom_spf": true, - "default": true, - "domain": "example.com", - "ips": [ - "192.168.1.1", - "192.168.1.2" - ], - "subdomain": "news", - "username": "john@example.com" -}'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->whitelabel()->domains()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_whitelabel_domains_get() - { - $query_params = json_decode('{"username": "test_string", "domain": "test_string", "exclude_subusers": "true", "limit": 1, "offset": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->domains()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_domains_default_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->domains()->default()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_domains_subuser_get() - { - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->domains()->subuser()->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_domains_subuser_delete() - { - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->whitelabel()->domains()->subuser()->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_whitelabel_domains__domain_id__patch() - { - $request_body = json_decode('{ - "custom_spf": true, - "default": false -}'); - $domain_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->domains()->_($domain_id)->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_domains__domain_id__get() - { - $domain_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->domains()->_($domain_id)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_domains__domain_id__delete() - { - $domain_id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->whitelabel()->domains()->_($domain_id)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_whitelabel_domains__domain_id__subuser_post() - { - $request_body = json_decode('{ - "username": "jane@example.com" -}'); - $domain_id = "test_url_param"; - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->whitelabel()->domains()->_($domain_id)->subuser()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_whitelabel_domains__id__ips_post() - { - $request_body = json_decode('{ - "ip": "192.168.0.1" -}'); - $id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->domains()->_($id)->ips()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_domains__id__ips__ip__delete() - { - $id = "test_url_param"; - $ip = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->domains()->_($id)->ips()->_($ip)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_domains__id__validate_post() - { - $id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->domains()->_($id)->validate()->post(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_ips_post() - { - $request_body = json_decode('{ - "domain": "example.com", - "ip": "192.168.1.1", - "subdomain": "email" -}'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->whitelabel()->ips()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_whitelabel_ips_get() - { - $query_params = json_decode('{"ip": "test_string", "limit": 1, "offset": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->ips()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_ips__id__get() - { - $id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->ips()->_($id)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_ips__id__delete() - { - $id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->whitelabel()->ips()->_($id)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_whitelabel_ips__id__validate_post() - { - $id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->ips()->_($id)->validate()->post(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_links_post() - { - $request_body = json_decode('{ - "default": true, - "domain": "example.com", - "subdomain": "mail" -}'); - $query_params = json_decode('{"limit": 1, "offset": 1}'); - $request_headers = array("X-Mock: 201"); - $response = self::$sg->client->whitelabel()->links()->post($request_body, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 201); - } - - public function test_whitelabel_links_get() - { - $query_params = json_decode('{"limit": 1}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->links()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_links_default_get() - { - $query_params = json_decode('{"domain": "test_string"}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->links()->default()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_links_subuser_get() - { - $query_params = json_decode('{"username": "test_string"}'); - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->links()->subuser()->get(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_links_subuser_delete() - { - $query_params = json_decode('{"username": "test_string"}'); - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->whitelabel()->links()->subuser()->delete(null, $query_params, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_whitelabel_links__id__patch() - { - $request_body = json_decode('{ - "default": true -}'); - $id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->links()->_($id)->patch($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_links__id__get() - { - $id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->links()->_($id)->get(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_links__id__delete() - { - $id = "test_url_param"; - $request_headers = array("X-Mock: 204"); - $response = self::$sg->client->whitelabel()->links()->_($id)->delete(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 204); - } - - public function test_whitelabel_links__id__validate_post() - { - $id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->links()->_($id)->validate()->post(null, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public function test_whitelabel_links__link_id__subuser_post() - { - $request_body = json_decode('{ - "username": "jane@example.com" -}'); - $link_id = "test_url_param"; - $request_headers = array("X-Mock: 200"); - $response = self::$sg->client->whitelabel()->links()->_($link_id)->subuser()->post($request_body, null, $request_headers); - $this->assertEquals($response->statusCode(), 200); - } - - public static function tearDownAfterClass() - { - $command = 'kill '.self::$pid; - exec($command); - print("\nPrism shut down"); - } -} diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/unit/bootstrap.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/unit/bootstrap.php deleted file mode 100644 index d04672a..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/unit/bootstrap.php +++ /dev/null @@ -1,2 +0,0 @@ -<?php -//include(dirname(dirname(__FILE__)) . '/../lib/loader.php'); diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/unit/helpers/mail/MailTest.php b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/unit/helpers/mail/MailTest.php deleted file mode 100644 index cb4a71e..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/unit/helpers/mail/MailTest.php +++ /dev/null @@ -1,183 +0,0 @@ -<?php -namespace SendGrid; - -class MailTest_Mail extends \PHPUnit_Framework_TestCase -{ - public function testBaseLineExample() - { - $from = new Email(null, "test@example.com"); - $to = new Email(null, "test@example.com"); - $subject = "Hello World from the SendGrid PHP Library"; - $content = new Content("text/plain", "some text here"); - $mail = new Mail($from, $subject, $to, $content); - - $content = new Content("text/html", "<html><body>some text here</body></html>"); - $mail->addContent($content); - - $json = json_encode($mail); - - $this->assertEquals($json, '{"from":{"email":"test@example.com"},"personalizations":[{"to":[{"email":"test@example.com"}]}],"subject":"Hello World from the SendGrid PHP Library","content":[{"type":"text\/plain","value":"some text here"},{"type":"text\/html","value":"<html><body>some text here<\/body><\/html>"}]}'); - } - - public function testKitchenSinkExample() - { - $from = new Email("DX", "test@example.com"); - $subject = "Hello World from the SendGrid PHP Library"; - $to = new Email("Example User", "test@example.com"); - $content = new Content("text/plain", "some text here"); - $mail = new Mail($from, $subject, $to, $content); - - $email = new Email("Example User", "test@example.com"); - $mail->personalization[0]->addTo($email); - $email = new Email("Example User", "test@example.com"); - $mail->personalization[0]->addCc($email); - $email = new Email("Example User", "test@example.com"); - $mail->personalization[0]->addCc($email); - $email = new Email("Example User", "test@example.com"); - $mail->personalization[0]->addBcc($email); - $email = new Email("Example User", "test@example.com"); - $mail->personalization[0]->addBcc($email); - $mail->personalization[0]->setSubject("Hello World from the SendGrid PHP Library"); - $mail->personalization[0]->addHeader("X-Test", "test"); - $mail->personalization[0]->addHeader("X-Mock", "true"); - $mail->personalization[0]->addSubstitution("%name%", "Example User"); - $mail->personalization[0]->addSubstitution("%city%", "Denver"); - $mail->personalization[0]->addCustomArg("user_id", "343"); - $mail->personalization[0]->addCustomArg("type", "marketing"); - $mail->personalization[0]->setSendAt(1443636843); - - $personalization1 = new Personalization(); - $email = new Email("Example User", "test@example.com"); - $personalization1->addTo($email); - $email = new Email("Example User", "test@example.com"); - $personalization1->addTo($email); - $email = new Email("Example User", "test@example.com"); - $personalization1->addCc($email); - $email = new Email("Example User", "test@example.com"); - $personalization1->addCc($email); - $email = new Email("Example User", "test@example.com"); - $personalization1->addBcc($email); - $email = new Email("Example User", "test@example.com"); - $personalization1->addBcc($email); - $personalization1->setSubject("Hello World from the SendGrid PHP Library"); - $personalization1->addHeader("X-Test", "test"); - $personalization1->addHeader("X-Mock", "true"); - $personalization1->addSubstitution("%name%", "Example User"); - $personalization1->addSubstitution("%city%", "Denver"); - $personalization1->addCustomArg("user_id", "343"); - $personalization1->addCustomArg("type", "marketing"); - $personalization1->setSendAt(1443636843); - $mail->addPersonalization($personalization1); - - $content = new Content("text/html", "<html><body>some text here</body></html>"); - $mail->addContent($content); - - $attachment = new Attachment(); - $attachment->setContent("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12"); - $attachment->setType("application/pdf"); - $attachment->setFilename("balance_001.pdf"); - $attachment->setDisposition("attachment"); - $attachment->setContentId("Balance Sheet"); - $mail->addAttachment($attachment); - - $attachment2 = new Attachment(); - $attachment2->setContent("BwdW"); - $attachment2->setType("image/png"); - $attachment2->setFilename("banner.png"); - $attachment2->setDisposition("inline"); - $attachment2->setContentId("Banner"); - $mail->addAttachment($attachment2); - - $mail->setTemplateId("439b6d66-4408-4ead-83de-5c83c2ee313a"); - - $mail->addSection("%section1%", "Substitution Text for Section 1"); - $mail->addSection("%section2%", "Substitution Text for Section 2"); - - $mail->addHeader("X-Test1", "1"); - $mail->addHeader("X-Test2", "2"); - - $mail->addCategory("May"); - $mail->addCategory("2016"); - - $mail->addCustomArg("campaign", "welcome"); - $mail->addCustomArg("weekday", "morning"); - - $mail->setSendAt(1443636842); - - $asm = new ASM(); - $asm->setGroupId(99); - $asm->setGroupsToDisplay([4,5,6,7,8]); - $mail->setASM($asm); - - $mail->setIpPoolName("23"); - - $mail_settings = new MailSettings(); - $bcc_settings = new BccSettings(); - $bcc_settings->setEnable(true); - $bcc_settings->setEmail("test@example.com"); - $mail_settings->setBccSettings($bcc_settings); - $sandbox_mode = new SandBoxMode(); - $sandbox_mode->setEnable(true); - $mail_settings->setSandboxMode($sandbox_mode); - $bypass_list_management = new BypassListManagement(); - $bypass_list_management->setEnable(true); - $mail_settings->setBypassListManagement($bypass_list_management); - $footer = new Footer(); - $footer->setEnable(true); - $footer->setText("Footer Text"); - $footer->setHtml("<html><body>Footer Text</body></html>"); - $mail_settings->setFooter($footer); - $spam_check = new SpamCheck(); - $spam_check->setEnable(true); - $spam_check->setThreshold(1); - $spam_check->setPostToUrl("https://spamcatcher.sendgrid.com"); - $mail_settings->setSpamCheck($spam_check); - $mail->setMailSettings($mail_settings); - - $tracking_settings = new TrackingSettings(); - $click_tracking = new ClickTracking(); - $click_tracking->setEnable(true); - $click_tracking->setEnableText(true); - $tracking_settings->setClickTracking($click_tracking); - $open_tracking = new OpenTracking(); - $open_tracking->setEnable(true); - $open_tracking->setSubstitutionTag("Optional tag to replace with the open image in the body of the message"); - $tracking_settings->setOpenTracking($open_tracking); - $subscription_tracking = new SubscriptionTracking(); - $subscription_tracking->setEnable(true); - $subscription_tracking->setText("text to insert into the text/plain portion of the message"); - $subscription_tracking->setHtml("<html><body>html to insert into the text/html portion of the message</body></html>"); - $subscription_tracking->setSubstitutionTag("Optional tag to replace with the open image in the body of the message"); - $tracking_settings->setSubscriptionTracking($subscription_tracking); - $ganalytics = new Ganalytics(); - $ganalytics->setEnable(true); - $ganalytics->setCampaignSource("some source"); - $ganalytics->setCampaignTerm("some term"); - $ganalytics->setCampaignContent("some content"); - $ganalytics->setCampaignName("some name"); - $ganalytics->setCampaignMedium("some medium"); - $tracking_settings->setGanalytics($ganalytics); - $mail->setTrackingSettings($tracking_settings); - - $reply_to = new ReplyTo("test@example.com", "Optional Name"); - $mail->setReplyTo($reply_to); - - $json = json_encode($mail); - - $this->assertEquals($json, '{"from":{"name":"DX","email":"test@example.com"},"personalizations":[{"to":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"cc":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"bcc":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"subject":"Hello World from the SendGrid PHP Library","headers":{"X-Test":"test","X-Mock":"true"},"substitutions":{"%name%":"Example User","%city%":"Denver"},"custom_args":{"user_id":"343","type":"marketing"},"send_at":1443636843},{"to":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"cc":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"bcc":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"subject":"Hello World from the SendGrid PHP Library","headers":{"X-Test":"test","X-Mock":"true"},"substitutions":{"%name%":"Example User","%city%":"Denver"},"custom_args":{"user_id":"343","type":"marketing"},"send_at":1443636843}],"subject":"Hello World from the SendGrid PHP Library","content":[{"type":"text\/plain","value":"some text here"},{"type":"text\/html","value":"<html><body>some text here<\/body><\/html>"}],"attachments":[{"content":"TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12","type":"application\/pdf","filename":"balance_001.pdf","disposition":"attachment","content_id":"Balance Sheet"},{"content":"BwdW","type":"image\/png","filename":"banner.png","disposition":"inline","content_id":"Banner"}],"template_id":"439b6d66-4408-4ead-83de-5c83c2ee313a","sections":{"%section1%":"Substitution Text for Section 1","%section2%":"Substitution Text for Section 2"},"headers":{"X-Test1":"1","X-Test2":"2"},"categories":["May","2016"],"custom_args":{"campaign":"welcome","weekday":"morning"},"send_at":1443636842,"asm":{"group_id":99,"groups_to_display":[4,5,6,7,8]},"ip_pool_name":"23","mail_settings":{"bcc":{"enable":true,"email":"test@example.com"},"bypass_list_management":{"enable":true},"footer":{"enable":true,"text":"Footer Text","html":"<html><body>Footer Text<\/body><\/html>"},"sandbox_mode":{"enable":true},"spam_check":{"enable":true,"threshold":1,"post_to_url":"https:\/\/spamcatcher.sendgrid.com"}},"tracking_settings":{"click_tracking":{"enable":true,"enable_text":true},"open_tracking":{"enable":true,"substitution_tag":"Optional tag to replace with the open image in the body of the message"},"subscription_tracking":{"enable":true,"text":"text to insert into the text\/plain portion of the message","html":"<html><body>html to insert into the text\/html portion of the message<\/body><\/html>","substitution_tag":"Optional tag to replace with the open image in the body of the message"},"ganalytics":{"enable":true,"utm_source":"some source","utm_medium":"some medium","utm_term":"some term","utm_content":"some content","utm_campaign":"some name"}},"reply_to":{"email":"test@example.com","name":"Optional Name"}}'); - - $reply_to = new ReplyTo("test@example.com"); - $mail->setReplyTo($reply_to); - - $json = json_encode($mail); - - $this->assertEquals($json, '{"from":{"name":"DX","email":"test@example.com"},"personalizations":[{"to":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"cc":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"bcc":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"subject":"Hello World from the SendGrid PHP Library","headers":{"X-Test":"test","X-Mock":"true"},"substitutions":{"%name%":"Example User","%city%":"Denver"},"custom_args":{"user_id":"343","type":"marketing"},"send_at":1443636843},{"to":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"cc":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"bcc":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"subject":"Hello World from the SendGrid PHP Library","headers":{"X-Test":"test","X-Mock":"true"},"substitutions":{"%name%":"Example User","%city%":"Denver"},"custom_args":{"user_id":"343","type":"marketing"},"send_at":1443636843}],"subject":"Hello World from the SendGrid PHP Library","content":[{"type":"text\/plain","value":"some text here"},{"type":"text\/html","value":"<html><body>some text here<\/body><\/html>"}],"attachments":[{"content":"TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12","type":"application\/pdf","filename":"balance_001.pdf","disposition":"attachment","content_id":"Balance Sheet"},{"content":"BwdW","type":"image\/png","filename":"banner.png","disposition":"inline","content_id":"Banner"}],"template_id":"439b6d66-4408-4ead-83de-5c83c2ee313a","sections":{"%section1%":"Substitution Text for Section 1","%section2%":"Substitution Text for Section 2"},"headers":{"X-Test1":"1","X-Test2":"2"},"categories":["May","2016"],"custom_args":{"campaign":"welcome","weekday":"morning"},"send_at":1443636842,"asm":{"group_id":99,"groups_to_display":[4,5,6,7,8]},"ip_pool_name":"23","mail_settings":{"bcc":{"enable":true,"email":"test@example.com"},"bypass_list_management":{"enable":true},"footer":{"enable":true,"text":"Footer Text","html":"<html><body>Footer Text<\/body><\/html>"},"sandbox_mode":{"enable":true},"spam_check":{"enable":true,"threshold":1,"post_to_url":"https:\/\/spamcatcher.sendgrid.com"}},"tracking_settings":{"click_tracking":{"enable":true,"enable_text":true},"open_tracking":{"enable":true,"substitution_tag":"Optional tag to replace with the open image in the body of the message"},"subscription_tracking":{"enable":true,"text":"text to insert into the text\/plain portion of the message","html":"<html><body>html to insert into the text\/html portion of the message<\/body><\/html>","substitution_tag":"Optional tag to replace with the open image in the body of the message"},"ganalytics":{"enable":true,"utm_source":"some source","utm_medium":"some medium","utm_term":"some term","utm_content":"some content","utm_campaign":"some name"}},"reply_to":{"email":"test@example.com"}}'); - - $reply_to = new ReplyTo("test@example.com", null); - $mail->setReplyTo($reply_to); - - $json = json_encode($mail); - - $this->assertEquals($json, '{"from":{"name":"DX","email":"test@example.com"},"personalizations":[{"to":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"cc":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"bcc":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"subject":"Hello World from the SendGrid PHP Library","headers":{"X-Test":"test","X-Mock":"true"},"substitutions":{"%name%":"Example User","%city%":"Denver"},"custom_args":{"user_id":"343","type":"marketing"},"send_at":1443636843},{"to":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"cc":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"bcc":[{"name":"Example User","email":"test@example.com"},{"name":"Example User","email":"test@example.com"}],"subject":"Hello World from the SendGrid PHP Library","headers":{"X-Test":"test","X-Mock":"true"},"substitutions":{"%name%":"Example User","%city%":"Denver"},"custom_args":{"user_id":"343","type":"marketing"},"send_at":1443636843}],"subject":"Hello World from the SendGrid PHP Library","content":[{"type":"text\/plain","value":"some text here"},{"type":"text\/html","value":"<html><body>some text here<\/body><\/html>"}],"attachments":[{"content":"TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12","type":"application\/pdf","filename":"balance_001.pdf","disposition":"attachment","content_id":"Balance Sheet"},{"content":"BwdW","type":"image\/png","filename":"banner.png","disposition":"inline","content_id":"Banner"}],"template_id":"439b6d66-4408-4ead-83de-5c83c2ee313a","sections":{"%section1%":"Substitution Text for Section 1","%section2%":"Substitution Text for Section 2"},"headers":{"X-Test1":"1","X-Test2":"2"},"categories":["May","2016"],"custom_args":{"campaign":"welcome","weekday":"morning"},"send_at":1443636842,"asm":{"group_id":99,"groups_to_display":[4,5,6,7,8]},"ip_pool_name":"23","mail_settings":{"bcc":{"enable":true,"email":"test@example.com"},"bypass_list_management":{"enable":true},"footer":{"enable":true,"text":"Footer Text","html":"<html><body>Footer Text<\/body><\/html>"},"sandbox_mode":{"enable":true},"spam_check":{"enable":true,"threshold":1,"post_to_url":"https:\/\/spamcatcher.sendgrid.com"}},"tracking_settings":{"click_tracking":{"enable":true,"enable_text":true},"open_tracking":{"enable":true,"substitution_tag":"Optional tag to replace with the open image in the body of the message"},"subscription_tracking":{"enable":true,"text":"text to insert into the text\/plain portion of the message","html":"<html><body>html to insert into the text\/html portion of the message<\/body><\/html>","substitution_tag":"Optional tag to replace with the open image in the body of the message"},"ganalytics":{"enable":true,"utm_source":"some source","utm_medium":"some medium","utm_term":"some term","utm_content":"some content","utm_campaign":"some name"}},"reply_to":{"email":"test@example.com"}}'); - } -} diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/unit/phpunit.xml.dist b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/unit/phpunit.xml.dist deleted file mode 100644 index f216f0f..0000000 --- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/unit/phpunit.xml.dist +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<phpunit bootstrap="bootstrap.php"> - <testsuites> - <testsuite name="General"> - <file>./SendGrid.php</file> - <file>./helpers/mail/Mail.php</file> - </testsuite> - </testsuites> -</phpunit> @@ -3,7 +3,7 @@ Contributors: yehudah, jasonhendriks Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=yehuda@myinbox.in&item_name=Donation+for+PostSMTP Tags: postman smtp, postman, smtp, email, mail, mailer, email log, oauth2, gmail, google apps, hotmail, yahoo, mandrill api, sendgrid api, elastic email, office365, mailgun Requires at least: 3.9 -Tested up to: 4.9.4 +Tested up to: 4.9.5 Stable tag: 1.8.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -12,23 +12,21 @@ Send, log and troubleshoot your Outgoing Email easily. Supports everything: SMTP == Description == -= From now all the support is made on Post SMTP forums = -https://postmansmtp.com/forums/ += WordPress Mail SMTP Plugin = = Postman SMTP is back! = Now under new maintenance, no need to search for another SMTP plugin anymore. -= The Most Fast And Easy = -See how fast and easy to setup Post SMTP with Google/Gsuite or any SMTP service. +Post SMTP is a next-generation WP Mail SMTP plugin, that assists in the delivery of email generated by your WordPress site. Post SMTP is the first and only plugin to support the [latest security standards](http://googleonlinesecurity.blogspot.ca/2014/04/new-security-measures-will-affect-older.html). With OAuth 2.0, there is **no need** to [store your email passsword](http://blog.codinghorror.com/youre-probably-storing-passwords-incorrectly/) in the WordPress database where it might be found. -https://www.youtube.com/watch?v=z-x1DhcAN0o +The **Connectivity Test** and intelligent **Setup Wizard** scan your SMTP server to detect firewall blocks and eliminate configuration mistakes. The built-in **Email Log** is an invaluable resource for [diagnosing problems](https://wordpress.org/support/topic/ugly-e-mails-no-html-and-no-special-characters?replies=15) with emails. Even hosts that block the standard SMTP ports, like GoDaddy or Bluehost, can't stop your email as **Post SMTP can deliver via HTTPS** if it can't use SMTP. +Post SMTP is *not* another WP Mail SMTP clone like WP Bank or Easy SMTP. It replaces the default WordPress SMTP library, PHPMailer, with the heavy-duty Zend_Mail. Never [lose an email to PHP mail()](http://www.jvfconsulting.com/blog/php-mail-function-vs-smtp-guaranteed-delivery/) again. -Post is a next-generation [SMTP Mailer](https://wordpress.org/plugins/search.php?q=smtp), software that assists in the delivery of email generated by your WordPress site. Post is the first and only plugin to support the [latest security standards](http://googleonlinesecurity.blogspot.ca/2014/04/new-security-measures-will-affect-older.html). With OAuth 2.0, there is **no need** to [store your email passsword](http://blog.codinghorror.com/youre-probably-storing-passwords-incorrectly/) in the WordPress database where it might be found. - -The **Connectivity Test** and intelligent **Setup Wizard** scan your SMTP server to detect firewall blocks and eliminate configuration mistakes. The built-in **Email Log** is an invaluable resource for [diagnosing problems](https://wordpress.org/support/topic/ugly-e-mails-no-html-and-no-special-characters?replies=15) with emails. Even hosts that block the standard SMTP ports, like GoDaddy or Bluehost, can't stop your email as **Post can deliver via HTTPS** if it can't use SMTP. += The Most Fast And Easy = +See how fast and easy to setup Post SMTP with Google/Gsuite or any SMTP service. -Post is *not* another WP Mail SMTP clone like WP Bank or Easy SMTP. It replaces the default WordPress SMTP library, PHPMailer, with the heavy-duty Zend_Mail. Never [lose an email to PHP mail()](http://www.jvfconsulting.com/blog/php-mail-function-vs-smtp-guaranteed-delivery/) again. +https://www.youtube.com/watch?v=z-x1DhcAN0o = Standard Features = * Easy-to-use, powerful Setup Wizard for perfect configuration @@ -45,16 +43,26 @@ Post is *not* another WP Mail SMTP clone like WP Bank or Easy SMTP. It replaces * Fire-and-forget delivery continues even if your password changes * Gmail: By combining OAuth2 and the Gmail API, Post can deliver where other plugins can not -= WebService (HTTPS) Email Features = += API (HTTPS) Email Support = * Gmail API for sending Gmail and Google Apps email (requires a [Google](https://accounts.google.com/signup) account) +Often bloggers and small business owners don't want to use third-party SMTP services. Well you can use your Gmail or G Suite account for SMTP emails. +<a href="https://www.cloudways.com/blog/post-smtp-mailer-fork-of-wordpress-postman-smtp-plugin/" rel="friend">Check the guide I wrote</a> + * Mandrill API for sending any email (requires a [Mandrill](http://www.mandrillapp.com) account) -* COMING SOON: Sparkpost API for sending any email (requires a [Sparkpost](https://www.sparkpost.com) account) +Mandrill is an email infrastructure service offered as an add-on for MailChimp that you can use to send personalized, one-to-one e-commerce emails, or automated transactional emails. + +* Mailgun API for sending any email (requires a [Mailgun](http://www.mailgun.com) account) +Mailgun SMTP is a popular SMTP service provider that allows you to send large quantities of emails. They allow you to send your first 10,000 emails for free every month. + * SendGrid API for sending any email (requires a [SendGrid](https://sendgrid.com) account and PHP 5.3) +SendGrid has a free SMTP plan that you can use to send up to 100 emails per day. With our native SendGrid SMTP integration, you can easily and securely set up SendGrid SMTP on your WordPress site. -> Post needs [translators](https://translate.wordpress.org/projects/wp-plugins/post-smtp/stable)! If you are a non-English speaker, please get involved! +> Post SMTP needs [translators](https://translate.wordpress.org/projects/wp-plugins/post-smtp/stable)! If you are a non-English speaker, please get involved! = Compatibile With.. = * [Woocommerce](https://wordpress.org/plugins/woocommerce/) +* [WPForms](https://wordpress.org/plugins/wpforms-lite/) +* [Elementor Forms](https://elementor.com/features/form-widget/) * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/) * [Gravity Forms](http://www.gravityforms.com) * [Fast Secure Contact Form](https://wordpress.org/plugins/si-contact-form/) @@ -76,7 +84,9 @@ Post is *not* another WP Mail SMTP clone like WP Bank or Easy SMTP. It replaces * Reliable SMTP delivery requires credentials with an email service provider * OAuth 2.0 features require a Gmail, Hotmail or Yahoo mail OAuth 2.0 credentials += CREDITS = +Post SMTP (aka Postman SMTP) plugin was originally created by Jason Hendriks. It is now owned and maintained by Yehuda Hassine. == Installation == |