summaryrefslogtreecommitdiffstats
path: root/examples/transmission/simple_send.php
diff options
context:
space:
mode:
authorbeardyman <nornholdj@gmail.com>2015-09-25 18:31:07 -0400
committerbeardyman <nornholdj@gmail.com>2015-09-25 18:31:07 -0400
commit607806af09c45e1b504ba06c3d33d9cb613d27c2 (patch)
tree3a709b001d1affae913a4dda938f4f45429ce1a4 /examples/transmission/simple_send.php
parent20b7f920e5527f421049a22227759cfe89318cc3 (diff)
downloadphp-sparkpost-607806af09c45e1b504ba06c3d33d9cb613d27c2.zip
php-sparkpost-607806af09c45e1b504ba06c3d33d9cb613d27c2.tar.gz
php-sparkpost-607806af09c45e1b504ba06c3d33d9cb613d27c2.tar.bz2
updated scripts to make template and updated example files to read new config file
Diffstat (limited to 'examples/transmission/simple_send.php')
-rw-r--r--examples/transmission/simple_send.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/transmission/simple_send.php b/examples/transmission/simple_send.php
index 8149238..eafc176 100644
--- a/examples/transmission/simple_send.php
+++ b/examples/transmission/simple_send.php
@@ -1,12 +1,15 @@
<?php
-namespace Examples\Transmisson;
+namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
+//pull in API key config
+$configFile = file_get_contents(dirname(__FILE__) . "/../example-config.json");
+$config = json_decode($configFile, true);
+
use SparkPost\SparkPost;
use SparkPost\Transmission;
-$key = 'YOURAPIKEY';
-SparkPost::setConfig(array('key'=>$key));
+SparkPost::setConfig(array('key'=>$config['api-key']));
try {
$results = Transmission::send(array(
@@ -26,4 +29,4 @@ try {
} catch (\Exception $exception) {
echo $exception->getMessage();
}
-?> \ No newline at end of file
+?>