summaryrefslogtreecommitdiffstats
path: root/examples/transmission/stored_recipients_inline_content.php
diff options
context:
space:
mode:
Diffstat (limited to 'examples/transmission/stored_recipients_inline_content.php')
-rw-r--r--examples/transmission/stored_recipients_inline_content.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/examples/transmission/stored_recipients_inline_content.php b/examples/transmission/stored_recipients_inline_content.php
index dbb7c1d..42e40df 100644
--- a/examples/transmission/stored_recipients_inline_content.php
+++ b/examples/transmission/stored_recipients_inline_content.php
@@ -3,23 +3,26 @@ 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(
+ $results = Transmission::send([
"campaign"=>"my-campaign",
- "from"=>"From Envelope <from@example.com>",
+ "from"=>"From Envelope <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 can use your SDK!';
} catch (\Exception $exception) {
echo $exception->getMessage();
}
-?> \ No newline at end of file
+?>