diff options
Diffstat (limited to 'examples/transmission/simple_send.php')
-rw-r--r-- | examples/transmission/simple_send.php | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/examples/transmission/simple_send.php b/examples/transmission/simple_send.php index 5844ecc..245af70 100644 --- a/examples/transmission/simple_send.php +++ b/examples/transmission/simple_send.php @@ -14,21 +14,24 @@ $httpAdapter = new Guzzle6HttpAdapter(new Client()); $sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]); try { - $results = $sparky->transmission->send([ - 'from'=>'From Envelope <from@sparkpostbox.com>', - 'html'=>'<p>Hello World!</p>', - 'text'=>'Hello World!', - 'subject'=>'Example Email', - 'recipients'=>[ - [ - 'address'=>[ - 'email'=>'john.doe@example.com' + $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 can use your SDK!'; + ]); + echo 'Congrats you can use your SDK!'; } catch (\Exception $exception) { - echo $exception->getMessage(); + echo $exception->getMessage(); } ?> |