diff options
Diffstat (limited to 'examples/transmission/stored_template_send.php')
-rw-r--r-- | examples/transmission/stored_template_send.php | 38 |
1 files changed, 0 insertions, 38 deletions
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"; -} |