diff options
author | Avi Goldman <avrahamymgoldman@gmail.com> | 2016-06-22 11:46:29 -0400 |
---|---|---|
committer | Avi Goldman <avrahamymgoldman@gmail.com> | 2016-06-22 11:46:29 -0400 |
commit | b1687e3d55960ba1810bb84be72c6307a6c5a2f3 (patch) | |
tree | 39b95cf55523dceb2d4216998139b19c49fa8595 | |
parent | 9cf58b85b7c771af97b5d95735c090551809db7f (diff) | |
download | php-sparkpost-b1687e3d55960ba1810bb84be72c6307a6c5a2f3.zip php-sparkpost-b1687e3d55960ba1810bb84be72c6307a6c5a2f3.tar.gz php-sparkpost-b1687e3d55960ba1810bb84be72c6307a6c5a2f3.tar.bz2 |
removed old tests
-rw-r--r-- | examples/transmission/delete_transmission.php | 25 | ||||
-rw-r--r-- | examples/transmission/get_all_transmissions.php | 25 | ||||
-rw-r--r-- | examples/transmission/get_transmission.php | 25 | ||||
-rw-r--r-- | examples/transmission/rfc822.php | 34 | ||||
-rw-r--r-- | examples/transmission/send_transmission_all_fields.php | 69 | ||||
-rw-r--r-- | examples/transmission/send_with_bcc.php | 58 | ||||
-rw-r--r-- | examples/transmission/send_with_cc.php | 62 | ||||
-rw-r--r-- | examples/transmission/simple_send.php | 40 | ||||
-rw-r--r-- | examples/transmission/stored_recipients_inline_content.php | 36 | ||||
-rw-r--r-- | examples/transmission/stored_template_send.php | 38 | ||||
-rw-r--r-- | examples/unwrapped/create_template.php | 35 | ||||
-rw-r--r-- | examples/unwrapped/create_transmission.php | 46 | ||||
-rw-r--r-- | examples/unwrapped/get_webhooks.php | 28 |
13 files changed, 0 insertions, 521 deletions
diff --git a/examples/transmission/delete_transmission.php b/examples/transmission/delete_transmission.php deleted file mode 100644 index f7d0530..0000000 --- a/examples/transmission/delete_transmission.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Examples\Transmisson; - -require_once dirname(__FILE__).'/../bootstrap.php'; - -//pull in API key config -$configFile = file_get_contents(dirname(__FILE__).'/../example-config.json'); -$config = json_decode($configFile, true); - -use SparkPost\SparkPost; -use GuzzleHttp\Client; -use Ivory\HttpAdapter\Guzzle6HttpAdapter; - -$httpAdapter = new Guzzle6HttpAdapter(new Client()); -$sparky = new SparkPost($httpAdapter, ['key' => $config['api-key']]); - -try { - $results = $sparky->transmission->delete('transmission-id'); - echo 'Transmission deleted!'; -} catch (\Exception $exception) { - echo $exception->getAPIMessage()."\n"; - echo $exception->getAPICode()."\n"; - echo $exception->getAPIDescription()."\n"; -} diff --git a/examples/transmission/get_all_transmissions.php b/examples/transmission/get_all_transmissions.php deleted file mode 100644 index c037b2d..0000000 --- a/examples/transmission/get_all_transmissions.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Examples\Transmisson; - -require_once dirname(__FILE__).'/../bootstrap.php'; - -//pull in API key config -$configFile = file_get_contents(dirname(__FILE__).'/../example-config.json'); -$config = json_decode($configFile, true); - -use SparkPost\SparkPost; -use GuzzleHttp\Client; -use Ivory\HttpAdapter\Guzzle6HttpAdapter; - -$httpAdapter = new Guzzle6HttpAdapter(new Client()); -$sparky = new SparkPost($httpAdapter, ['key' => $config['api-key']]); - -try { - $results = $sparky->transmission->all(); - echo 'Congrats! You got a list of all your transmissions from SparkPost!'; -} catch (\Exception $exception) { - echo $exception->getAPIMessage()."\n"; - echo $exception->getAPICode()."\n"; - echo $exception->getAPIDescription()."\n"; -} diff --git a/examples/transmission/get_transmission.php b/examples/transmission/get_transmission.php deleted file mode 100644 index 5d59740..0000000 --- a/examples/transmission/get_transmission.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Examples\Transmisson; - -require_once dirname(__FILE__).'/../bootstrap.php'; - -//pull in API key config -$configFile = file_get_contents(dirname(__FILE__).'/../example-config.json'); -$config = json_decode($configFile, true); - -use SparkPost\SparkPost; -use GuzzleHttp\Client; -use Ivory\HttpAdapter\Guzzle6HttpAdapter; - -$httpAdapter = new Guzzle6HttpAdapter(new Client()); -$sparky = new SparkPost($httpAdapter, ['key' => $config['api-key']]); - -try { - $results = $sparky->transmission->find('Your Transmission ID'); - echo 'Congrats! You retrieved your transmission from SparkPost!'; -} catch (\Exception $exception) { - echo $exception->getAPIMessage()."\n"; - echo $exception->getAPICode()."\n"; - echo $exception->getAPIDescription()."\n"; -} diff --git a/examples/transmission/rfc822.php b/examples/transmission/rfc822.php deleted file mode 100644 index df2b06b..0000000 --- a/examples/transmission/rfc822.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -namespace Examples\Transmisson; - -require_once dirname(__FILE__).'/../bootstrap.php'; - -//pull in API key config -$configFile = file_get_contents(dirname(__FILE__).'/../example-config.json'); -$config = json_decode($configFile, true); - -use SparkPost\SparkPost; -use GuzzleHttp\Client; -use Ivory\HttpAdapter\Guzzle6HttpAdapter; - -$httpAdapter = new Guzzle6HttpAdapter(new Client()); -$sparky = new SparkPost($httpAdapter, ['key' => $config['api-key']]); - -try { - $results = $sparky->transmission->send([ - 'recipients' => [ - [ - 'address' => [ - 'email' => 'john.doe@example.com', - ], - ], - ], - 'rfc822' => "Content-Type: text/plain\nFrom: From Envelope <from@sparkpostbox.com>\nSubject: Example Email\n\nHello World", - ]); - echo 'Congrats! You sent an email using SparkPost!'; -} catch (\Exception $exception) { - echo $exception->getAPIMessage()."\n"; - echo $exception->getAPICode()."\n"; - echo $exception->getAPIDescription()."\n"; -} diff --git a/examples/transmission/send_transmission_all_fields.php b/examples/transmission/send_transmission_all_fields.php deleted file mode 100644 index 986fd87..0000000 --- a/examples/transmission/send_transmission_all_fields.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -namespace Examples\Transmisson; - -require_once dirname(__FILE__).'/../bootstrap.php'; - -//pull in API key config -$configFile = file_get_contents(dirname(__FILE__).'/../example-config.json'); -$config = json_decode($configFile, true); - -use SparkPost\SparkPost; -use GuzzleHttp\Client; -use Ivory\HttpAdapter\Guzzle6HttpAdapter; - -$httpAdapter = new Guzzle6HttpAdapter(new Client()); -$sparky = new SparkPost($httpAdapter, ['key' => $config['api-key'], 'timeout' => 0]]); - -$data = file_get_contents('/path/to/test.csv'); - -try { - $results = $sparky->transmission->send([ - 'campaign' => 'my-campaign', - 'metadata' => [ - 'sample_campaign' => true, - 'type' => 'these are custom fields', - ], - 'substitutionData' => [ - 'name' => 'Test Name', - ], - 'description' => 'my description', - 'replyTo' => 'reply@test.com', - 'customHeaders' => [ - 'X-Custom-Header' => 'Sample Custom Header', - ], - 'trackOpens' => false, - 'trackClicks' => false, - 'sandbox' => false, - 'inlineCss' => true, - 'transactional' => true, - 'startTime' => '2016-03-17T08:00:00-04:00', - 'from' => [ - 'name' => 'From Envelope', - 'email' => 'from@sparkpostbox.com', - ], - 'html' => '<p>Hello World! Your name is: {{name}}</p>', - 'text' => 'Hello World!', - 'subject' => 'Example Email: {{name}}', - 'recipients' => [ - [ - 'address' => [ - 'email' => 'john.doe@example.com', - ], - ], - ], - 'attachments' => [ - [ - 'type' => 'text/csv', - 'name' => 'testing.csv', - 'data' => base64_encode($data), - ], - ], - ]); - - echo 'Congrats! You sent an email using SparkPost!'; -} catch (\Exception $exception) { - echo $exception->getAPIMessage()."\n"; - echo $exception->getAPICode()."\n"; - echo $exception->getAPIDescription()."\n"; -} diff --git a/examples/transmission/send_with_bcc.php b/examples/transmission/send_with_bcc.php deleted file mode 100644 index 7479c4a..0000000 --- a/examples/transmission/send_with_bcc.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/* - * For a more detailed explanation of how cc/bcc work with SparkPost, please - * check out this article: https://support.sparkpost.com/customer/portal/articles/1948014 - */ - -namespace Examples\Transmisson; - -require_once dirname(__FILE__).'/../bootstrap.php'; - -//pull in API key config -$configFile = file_get_contents(dirname(__FILE__).'/../example-config.json'); -$config = json_decode($configFile, true); - -use SparkPost\SparkPost; -use GuzzleHttp\Client; -use Ivory\HttpAdapter\Guzzle6HttpAdapter; - -$httpAdapter = new Guzzle6HttpAdapter(new Client()); -$sparky = new SparkPost($httpAdapter, ['key' => $config['api-key']]); - -try { - $results = $sparky->transmission->send([ - 'from' => [ - 'name' => 'From Envelope', - 'email' => 'from@sparkpostbox.com', - ], - 'html' => '<p>An example email using bcc with SparkPost to the {{recipient_type}} recipient.</p>', - 'text' => 'An example email using bcc with SparkPost to the {{recipient_type}} recipient.', - 'subject' => 'Example email using bcc', - 'recipients' => [ - [ - 'address' => [ - 'name' => 'Original Recipient', - 'email' => 'original.recipient@example.com', - ], - 'substitution_data' => [ - 'recipient_type' => 'Original', - ], - ], - [ - 'address' => [ - 'email' => 'bcc.recipient@example.com', - 'header_to' => '"Original Recipient" <original.recipient@example.com>', - ], - 'substitution_data' => [ - 'recipient_type' => 'BCC', - ], - ], - ], - ]); - echo 'Congrats! You sent an email with bcc using SparkPost!'; -} catch (\Exception $exception) { - echo $exception->getAPIMessage()."\n"; - echo $exception->getAPICode()."\n"; - echo $exception->getAPIDescription()."\n"; -} diff --git a/examples/transmission/send_with_cc.php b/examples/transmission/send_with_cc.php deleted file mode 100644 index 7ad2a7b..0000000 --- a/examples/transmission/send_with_cc.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -/* - * For a more detailed explanation of how cc/bcc work with SparkPost, please - * check out this article: https://support.sparkpost.com/customer/portal/articles/1948014 - */ - -namespace Examples\Transmisson; - -require_once dirname(__FILE__).'/../bootstrap.php'; - -//pull in API key config -$configFile = file_get_contents(dirname(__FILE__).'/../example-config.json'); -$config = json_decode($configFile, true); - -use SparkPost\SparkPost; -use GuzzleHttp\Client; -use Ivory\HttpAdapter\Guzzle6HttpAdapter; - -$httpAdapter = new Guzzle6HttpAdapter(new Client()); -$sparky = new SparkPost($httpAdapter, ['key' => $config['api-key']]); - -try { - $results = $sparky->transmission->send([ - 'from' => [ - 'name' => 'From Envelope', - 'email' => 'from@sparkpostbox.com', - ], - 'html' => '<p>An example email using cc with SparkPost to the {{recipient_type}} recipient.</p>', - 'text' => 'An example email using cc with SparkPost to the {{recipient_type}} recipient.', - 'subject' => 'Example email using cc', - 'recipients' => [ - [ - 'address' => [ - 'name' => 'Original Recipient', - 'email' => 'original.recipient@example.com', - ], - 'substitution_data' => [ - 'recipient_type' => 'Original', - ], - ], - [ - 'address' => [ - 'name' => 'Carbon Copy Recipient', - 'email' => 'cc.recipient@example.com', - 'header_to' => '"Original Recipient" <original.recipient@example.com>', - ], - 'substitution_data' => [ - 'recipient_type' => 'CC', - ], - ], - ], - 'customHeaders' => [ - 'CC' => '"Carbon Copy Recipient" <cc.recipient@example.com>', - ], - ]); - echo 'Congrats! You sent an email with cc using SparkPost!'; -} catch (\Exception $exception) { - echo $exception->getAPIMessage()."\n"; - echo $exception->getAPICode()."\n"; - echo $exception->getAPIDescription()."\n"; -} diff --git a/examples/transmission/simple_send.php b/examples/transmission/simple_send.php deleted file mode 100644 index 6bd0336..0000000 --- a/examples/transmission/simple_send.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -namespace Examples\Transmisson; - -require_once dirname(__FILE__).'/../bootstrap.php'; - -//pull in API key config -$configFile = file_get_contents(dirname(__FILE__).'/../example-config.json'); -$config = json_decode($configFile, true); - -use SparkPost\SparkPost; -use GuzzleHttp\Client; -use Ivory\HttpAdapter\Guzzle6HttpAdapter; - -$httpAdapter = new Guzzle6HttpAdapter(new Client()); -$sparky = new SparkPost($httpAdapter, ['key' => $config['api-key']]); - -try { - $results = $sparky->transmission->send([ - 'from' => [ - 'name' => 'From Envelope', - 'email' => 'from@sparkpostbox.com', - ], - 'html' => '<p>Hello World!</p>', - 'text' => 'Hello World!', - 'subject' => 'Example Email', - 'recipients' => [ - [ - 'address' => [ - 'email' => 'john.doe@example.com', - ], - ], - ], - ]); - echo 'Congrats! You sent an email using SparkPost!'; -} catch (\Exception $exception) { - echo $exception->getAPIMessage()."\n"; - echo $exception->getAPICode()."\n"; - echo $exception->getAPIDescription()."\n"; -} diff --git a/examples/transmission/stored_recipients_inline_content.php b/examples/transmission/stored_recipients_inline_content.php deleted file mode 100644 index 503908b..0000000 --- a/examples/transmission/stored_recipients_inline_content.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -namespace Examples\Transmisson; - -require_once dirname(__FILE__).'/../bootstrap.php'; - -//pull in API key config -$configFile = file_get_contents(dirname(__FILE__).'/../example-config.json'); -$config = json_decode($configFile, true); - -use SparkPost\SparkPost; -use GuzzleHttp\Client; -use Ivory\HttpAdapter\Guzzle6HttpAdapter; - -$httpAdapter = new Guzzle6HttpAdapter(new Client()); -$sparky = new SparkPost($httpAdapter, ['key' => $config['api-key']]); - -try { - $results = $sparky->transmission->send([ - 'campaign' => 'my-campaign', - 'from' => [ - 'name' => 'From Envelope', - 'email' => 'from@sparkpostbox.com', - ], - 'html' => '<p>Hello World! Your name is: {{name}}</p>', - 'text' => 'Hello World!', - 'subject' => 'Example Email: {{name}}', - 'recipientList' => 'Example List', - ]); - - echo 'Congrats! You sent an email using SparkPost!'; -} catch (\Exception $exception) { - echo $exception->getAPIMessage()."\n"; - echo $exception->getAPICode()."\n"; - echo $exception->getAPIDescription()."\n"; -} diff --git a/examples/transmission/stored_template_send.php b/examples/transmission/stored_template_send.php deleted file mode 100644 index 5ce48e4..0000000 --- a/examples/transmission/stored_template_send.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -namespace Examples\Transmisson; - -require_once dirname(__FILE__).'/../bootstrap.php'; - -//pull in API key config -$configFile = file_get_contents(dirname(__FILE__).'/../example-config.json'); -$config = json_decode($configFile, true); - -use SparkPost\SparkPost; -use GuzzleHttp\Client; -use Ivory\HttpAdapter\Guzzle6HttpAdapter; - -$httpAdapter = new Guzzle6HttpAdapter(new Client()); -$sparky = new SparkPost($httpAdapter, ['key' => $config['api-key']]); - -try { - $results = $sparky->transmission->send([ - 'from' => [ - 'name' => 'From Envelope', - 'email' => 'from@sparkpostbox.com', - ], - 'recipients' => [ - [ - 'address' => [ - 'email' => 'john.doe@example.com', - ], - ], - ], - 'template' => 'my-first-email', - ]); - echo 'Congrats! You sent an email using SparkPost!'; -} catch (\Exception $exception) { - echo $exception->getAPIMessage()."\n"; - echo $exception->getAPICode()."\n"; - echo $exception->getAPIDescription()."\n"; -} diff --git a/examples/unwrapped/create_template.php b/examples/unwrapped/create_template.php deleted file mode 100644 index 89523f1..0000000 --- a/examples/unwrapped/create_template.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -namespace Examples\Unwrapped; - -require_once dirname(__FILE__).'/../bootstrap.php'; - -//pull in API key config -$configFile = file_get_contents(dirname(__FILE__).'/../example-config.json'); -$config = json_decode($configFile, true); - -use SparkPost\SparkPost; -use GuzzleHttp\Client; -use Ivory\HttpAdapter\Guzzle6HttpAdapter; - -$httpAdapter = new Guzzle6HttpAdapter(new Client()); -$sparky = new SparkPost($httpAdapter, ['key' => $config['api-key']]); - -try { - // define the endpoint - $sparky->setupUnwrapped('templates'); - - $templateConfig = [ - 'name' => 'Summer Sale!', - 'id' => 'summer-sale', - 'content' => [ - 'from' => 'from@sparkpostbox.com', - 'subject' => 'Summer deals', - 'html' => '<b>Check out these deals!</b>', - ], - ]; - $results = $sparky->templates->create($templateConfig); - echo 'Congrats! You created a template using SparkPost!'; -} catch (\Exception $exception) { - echo $exception->getMessage(); -} diff --git a/examples/unwrapped/create_transmission.php b/examples/unwrapped/create_transmission.php deleted file mode 100644 index d3a44c5..0000000 --- a/examples/unwrapped/create_transmission.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -namespace Examples\Unwrapped; - -require_once dirname(__FILE__).'/../bootstrap.php'; - -//pull in API key config -$configFile = file_get_contents(dirname(__FILE__).'/../example-config.json'); -$config = json_decode($configFile, true); - -use SparkPost\SparkPost; -use GuzzleHttp\Client; -use Ivory\HttpAdapter\Guzzle6HttpAdapter; - -$httpAdapter = new Guzzle6HttpAdapter(new Client()); -$sparky = new SparkPost($httpAdapter, ['key' => $config['api-key']]); - -try { - // define the endpoint - $sparky->setupUnwrapped('transmissions'); - - $message = [ - 'recipients' => [ - [ - 'address' => [ - 'email' => 'john.doe@example.com', - ], - ], - ], - 'content' => [ - 'from' => [ - 'name' => 'From Envelope', - 'email' => 'from@sparkpostbox.com', - ], - 'html' => '<p>Hello World!</p>', - 'text' => 'Hello World!', - 'subject' => 'Example Email', - ], - ]; - $results = $sparky->transmissions->create($message); - echo 'Congrats! You sent a message using SparkPost!'; -} catch (\Exception $exception) { - echo $exception->getAPIMessage()."\n"; - echo $exception->getAPICode()."\n"; - echo $exception->getAPIDescription()."\n"; -} diff --git a/examples/unwrapped/get_webhooks.php b/examples/unwrapped/get_webhooks.php deleted file mode 100644 index 90f7a9c..0000000 --- a/examples/unwrapped/get_webhooks.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -namespace Examples\Unwrapped; - -require_once dirname(__FILE__).'/../bootstrap.php'; - -//pull in API key config -$configFile = file_get_contents(dirname(__FILE__).'/../example-config.json'); -$config = json_decode($configFile, true); - -use SparkPost\SparkPost; -use GuzzleHttp\Client; -use Ivory\HttpAdapter\Guzzle6HttpAdapter; - -$httpAdapter = new Guzzle6HttpAdapter(new Client()); -$sparky = new SparkPost($httpAdapter, ['key' => $config['api-key']]); - -try { - $sparky->setupUnwrapped('webhooks'); - - $results = $sparky->webhooks->get(); - - echo 'Congrats! You got a list of all your webhooks from SparkPost!'; -} catch (\Exception $exception) { - echo $exception->getAPIMessage()."\n"; - echo $exception->getAPICode()."\n"; - echo $exception->getAPIDescription()."\n"; -} |