diff options
Diffstat (limited to 'examples/transmission/configuration_based.php')
-rw-r--r-- | examples/transmission/configuration_based.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/transmission/configuration_based.php b/examples/transmission/configuration_based.php new file mode 100644 index 0000000..374f446 --- /dev/null +++ b/examples/transmission/configuration_based.php @@ -0,0 +1,31 @@ +<?php +namespace Examples\Transmisson; + require_once (dirname(__FILE__).'/../bootstrap.php'); + + use SparkPost\SparkPost; + + $key = 'YOURAPIKEY'; + $sdk = new SparkPost(['key'=>$key]); + + $transmission = $sdk->Transmission([ + "return_path"=>"return@example.com", + "from"=>"From Envelope <from@example.com>", + "html"=>"<p>Hello World!</p>", + "text"=>"Hello World!", + "subject"=>"Example Email", + "recipients"=>[ + [ + "address"=>[ + "email"=>"john.doe@sample.com" + ] + ] + ] + ]); + + try { + $results = $transmission->send(); + echo 'Congrats you can use your SDK!'; + } catch (\Exception $exception) { + echo $exception->getMessage(); + } +?>
\ No newline at end of file |