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 2e22609..3df4a95 100644
--- a/examples/transmission/stored_template_send.php
+++ b/examples/transmission/stored_template_send.php
@@ -14,19 +14,22 @@ $httpAdapter = new Guzzle6HttpAdapter(new Client());
$sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]);
try {
- $results = $sparky->transmission->send([
- 'from'=>'From Envelope <from@sparkpostbox.com>',
- 'recipients'=>[
- [
- 'address'=>[
- 'email'=>'john.doe@example.com'
- ]
- ]
- ],
- 'template'=>'my-first-email'
- ]);
- echo 'Congrats you can use your SDK!';
+ $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 can use your SDK!';
} catch (\Exception $exception) {
- echo $exception->getMessage();
+ echo $exception->getMessage();
}
?>