summaryrefslogtreecommitdiffstats
path: root/examples/transmission/send_with_cc.php
diff options
context:
space:
mode:
authorAvi Goldman <avrahamymgoldman@gmail.com>2016-06-22 11:46:29 -0400
committerAvi Goldman <avrahamymgoldman@gmail.com>2016-06-22 11:46:29 -0400
commitb1687e3d55960ba1810bb84be72c6307a6c5a2f3 (patch)
tree39b95cf55523dceb2d4216998139b19c49fa8595 /examples/transmission/send_with_cc.php
parent9cf58b85b7c771af97b5d95735c090551809db7f (diff)
downloadphp-sparkpost-b1687e3d55960ba1810bb84be72c6307a6c5a2f3.zip
php-sparkpost-b1687e3d55960ba1810bb84be72c6307a6c5a2f3.tar.gz
php-sparkpost-b1687e3d55960ba1810bb84be72c6307a6c5a2f3.tar.bz2
removed old tests
Diffstat (limited to 'examples/transmission/send_with_cc.php')
-rw-r--r--examples/transmission/send_with_cc.php62
1 files changed, 0 insertions, 62 deletions
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";
-}