summaryrefslogtreecommitdiffstats
path: root/examples/transmission/stored_template_send.php
diff options
context:
space:
mode:
Diffstat (limited to 'examples/transmission/stored_template_send.php')
-rw-r--r--examples/transmission/stored_template_send.php29
1 files changed, 16 insertions, 13 deletions
diff --git a/examples/transmission/stored_template_send.php b/examples/transmission/stored_template_send.php
index cda6de6..82be209 100644
--- a/examples/transmission/stored_template_send.php
+++ b/examples/transmission/stored_template_send.php
@@ -3,24 +3,27 @@ namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
use SparkPost\SparkPost;
use SparkPost\Transmission;
+use GuzzleHttp\Client;
+use Ivory\HttpAdapter\Guzzle6HttpAdapter;
-$key = 'YOURAPIKEY';
-SparkPost::setConfig(array('key'=>$key));
+$key = 'YOUR API KEY';
+$httpAdapter = new Guzzle6HttpAdapter(new Client());
+SparkPost::configure($httpAdapter, ['key'=>$key]);
try {
- $results = Transmission::send(array(
- "from"=>"From Envelope <from@example.com>",
- "recipients"=>array(
- array(
- "address"=>array(
- "email"=>"john.doe@sample.com"
- )
- )
- ),
+ $results = Transmission::send([
+ "from"=>"From Envelope <from@sparkpostbox.com>",
+ "recipients"=>[
+ [
+ "address"=>[
+ "email"=>"john.doe@example.com"
+ ]
+ ]
+ ],
"template"=>"my-template"
- ));
+ ]);
echo 'Congrats you can use your SDK!';
} catch (\Exception $exception) {
echo $exception->getMessage();
}
-?> \ No newline at end of file
+?>