summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorbeardyman <nornholdj@gmail.com>2015-10-02 16:27:30 -0400
committerbeardyman <nornholdj@gmail.com>2015-10-02 16:27:30 -0400
commit2f1b80397a83f7a6b9863919005dbf384553b3b1 (patch)
tree22f8be118f0a4d13cdfdc6bb33fec1860214d233 /examples
parent97e0d2643db1969e299349968eea1d9c7a951d7f (diff)
parentc2e4758d8df8cf7e20451ea3196f2dc918e245e1 (diff)
downloadphp-sparkpost-2f1b80397a83f7a6b9863919005dbf384553b3b1.zip
php-sparkpost-2f1b80397a83f7a6b9863919005dbf384553b3b1.tar.gz
php-sparkpost-2f1b80397a83f7a6b9863919005dbf384553b3b1.tar.bz2
merged master and resolved conflicts
Diffstat (limited to 'examples')
-rw-r--r--examples/transmission/get_all_transmissions.php7
-rw-r--r--examples/transmission/get_transmission.php7
-rw-r--r--examples/transmission/rfc822.php8
-rw-r--r--examples/transmission/send_transmission_all_fields.php8
-rw-r--r--examples/transmission/simple_send.php7
-rw-r--r--examples/transmission/stored_recipients_inline_content.php8
-rw-r--r--examples/transmission/stored_template_send.php8
-rw-r--r--examples/unwrapped/create_template.php8
8 files changed, 45 insertions, 16 deletions
diff --git a/examples/transmission/get_all_transmissions.php b/examples/transmission/get_all_transmissions.php
index bc57466..7baf4f1 100644
--- a/examples/transmission/get_all_transmissions.php
+++ b/examples/transmission/get_all_transmissions.php
@@ -2,13 +2,16 @@
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 GuzzleHttp\Client;
use Ivory\HttpAdapter\Guzzle6HttpAdapter;
-$key = 'YOUR API KEY';
$httpAdapter = new Guzzle6HttpAdapter(new Client());
-$sparky = new SparkPost($httpAdapter, ['key'=>$key]);
+$sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]);
try {
$results = $sparky->transmission->all();
diff --git a/examples/transmission/get_transmission.php b/examples/transmission/get_transmission.php
index 9303eca..1e749b9 100644
--- a/examples/transmission/get_transmission.php
+++ b/examples/transmission/get_transmission.php
@@ -2,13 +2,16 @@
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 GuzzleHttp\Client;
use Ivory\HttpAdapter\Guzzle6HttpAdapter;
-$key = 'YOUR API KEY';
$httpAdapter = new Guzzle6HttpAdapter(new Client());
-$sparky = new SparkPost($httpAdapter, ['key'=>$key]);
+$sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]);
try {
$results = $sparky->transmission->find('Your Transmission ID');
diff --git a/examples/transmission/rfc822.php b/examples/transmission/rfc822.php
index 2b10423..b11b34f 100644
--- a/examples/transmission/rfc822.php
+++ b/examples/transmission/rfc822.php
@@ -1,13 +1,17 @@
<?php
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 GuzzleHttp\Client;
use Ivory\HttpAdapter\Guzzle6HttpAdapter;
-$key = 'YOUR API KEY';
$httpAdapter = new Guzzle6HttpAdapter(new Client());
-$sparky = new SparkPost($httpAdapter, ['key'=>$key]);
+$sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]);
try {
$results = $sparky->transmission->send([
diff --git a/examples/transmission/send_transmission_all_fields.php b/examples/transmission/send_transmission_all_fields.php
index ea2a24d..044dcc2 100644
--- a/examples/transmission/send_transmission_all_fields.php
+++ b/examples/transmission/send_transmission_all_fields.php
@@ -1,13 +1,17 @@
<?php
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 GuzzleHttp\Client;
use Ivory\HttpAdapter\Guzzle6HttpAdapter;
-$key = 'YOUR API KEY';
$httpAdapter = new Guzzle6HttpAdapter(new Client());
-$sparky = new SparkPost($httpAdapter, ['key'=>$key]);
+$sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]);
try{
$results = $sparky->transmission->send([
diff --git a/examples/transmission/simple_send.php b/examples/transmission/simple_send.php
index 34df573..6dc3719 100644
--- a/examples/transmission/simple_send.php
+++ b/examples/transmission/simple_send.php
@@ -2,13 +2,16 @@
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 GuzzleHttp\Client;
use Ivory\HttpAdapter\Guzzle6HttpAdapter;
-$key = 'YOUR API KEY';
$httpAdapter = new Guzzle6HttpAdapter(new Client());
-$sparky = new SparkPost($httpAdapter, ['key'=>$key]);
+$sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]);
try {
$results = $sparky->transmission->send([
diff --git a/examples/transmission/stored_recipients_inline_content.php b/examples/transmission/stored_recipients_inline_content.php
index 9f3a55d..3e53507 100644
--- a/examples/transmission/stored_recipients_inline_content.php
+++ b/examples/transmission/stored_recipients_inline_content.php
@@ -1,13 +1,17 @@
<?php
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 GuzzleHttp\Client;
use Ivory\HttpAdapter\Guzzle6HttpAdapter;
-$key = 'YOUR API KEY';
$httpAdapter = new Guzzle6HttpAdapter(new Client());
-$sparky = new SparkPost($httpAdapter, ['key'=>$key]);
+$sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]);
try {
diff --git a/examples/transmission/stored_template_send.php b/examples/transmission/stored_template_send.php
index 60363ba..936d292 100644
--- a/examples/transmission/stored_template_send.php
+++ b/examples/transmission/stored_template_send.php
@@ -1,13 +1,17 @@
<?php
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 GuzzleHttp\Client;
use Ivory\HttpAdapter\Guzzle6HttpAdapter;
-$key = 'YOUR API KEY';
$httpAdapter = new Guzzle6HttpAdapter(new Client());
-$sparky = new SparkPost($httpAdapter, ['key'=>$key]);
+$sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]);
try {
$results = $sparky->transmission->send([
diff --git a/examples/unwrapped/create_template.php b/examples/unwrapped/create_template.php
index 51ab156..e28f158 100644
--- a/examples/unwrapped/create_template.php
+++ b/examples/unwrapped/create_template.php
@@ -1,13 +1,17 @@
<?php
namespace Examples\Unwrapped;
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 GuzzleHttp\Client;
use Ivory\HttpAdapter\Guzzle6HttpAdapter;
-$key = 'YOUR API KEY';
$httpAdapter = new Guzzle6HttpAdapter(new Client());
-$sparky = new SparkPost($httpAdapter, ['key'=>$key]);
+$sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]);
try {
// define the endpoint