summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorbeardyman <nornholdj@gmail.com>2015-10-03 11:05:25 -0400
committerbeardyman <nornholdj@gmail.com>2015-10-03 11:05:25 -0400
commitada533a743125008474de854a3f6bcec5c104fbe (patch)
treec640e50d2a4d9cacae7c7964260f18c3af5258a8 /examples
parent55d428cb95c10c7b94225760a663f28d50190091 (diff)
downloadphp-sparkpost-ada533a743125008474de854a3f6bcec5c104fbe.zip
php-sparkpost-ada533a743125008474de854a3f6bcec5c104fbe.tar.gz
php-sparkpost-ada533a743125008474de854a3f6bcec5c104fbe.tar.bz2
replaced tabs with two spaces. normalized quotes
Diffstat (limited to 'examples')
-rw-r--r--examples/transmission/get_all_transmissions.php6
-rw-r--r--examples/transmission/get_transmission.php6
-rw-r--r--examples/transmission/rfc822.php22
-rw-r--r--examples/transmission/send_transmission_all_fields.php58
-rw-r--r--examples/transmission/simple_send.php28
-rw-r--r--examples/transmission/stored_recipients_inline_content.php20
-rw-r--r--examples/transmission/stored_template_send.php22
-rw-r--r--examples/unwrapped/create_template.php22
8 files changed, 92 insertions, 92 deletions
diff --git a/examples/transmission/get_all_transmissions.php b/examples/transmission/get_all_transmissions.php
index 73eed92..afbe5aa 100644
--- a/examples/transmission/get_all_transmissions.php
+++ b/examples/transmission/get_all_transmissions.php
@@ -3,7 +3,7 @@ namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
//pull in API key config
-$configFile = file_get_contents(dirname(__FILE__) . "/../example-config.json");
+$configFile = file_get_contents(dirname(__FILE__) . '/../example-config.json');
$config = json_decode($configFile, true);
use SparkPost\SparkPost;
@@ -15,8 +15,8 @@ $sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]);
try {
$results = $sparky->transmission->all();
- echo 'Congrats you can use your SDK!';
+ echo 'Congrats you can use your SDK!';
} catch (\Exception $exception) {
- echo $exception->getMessage();
+ echo $exception->getMessage();
}
?>
diff --git a/examples/transmission/get_transmission.php b/examples/transmission/get_transmission.php
index f6af649..0bda953 100644
--- a/examples/transmission/get_transmission.php
+++ b/examples/transmission/get_transmission.php
@@ -3,7 +3,7 @@ namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
//pull in API key config
-$configFile = file_get_contents(dirname(__FILE__) . "/../example-config.json");
+$configFile = file_get_contents(dirname(__FILE__) . '/../example-config.json');
$config = json_decode($configFile, true);
use SparkPost\SparkPost;
@@ -15,8 +15,8 @@ $sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]);
try {
$results = $sparky->transmission->find('Your Transmission ID');
- echo 'Congrats you can use your SDK!';
+ echo 'Congrats you can use your SDK!';
} catch (\Exception $exception) {
- echo $exception->getMessage();
+ echo $exception->getMessage();
}
?>
diff --git a/examples/transmission/rfc822.php b/examples/transmission/rfc822.php
index 8221097..1054c57 100644
--- a/examples/transmission/rfc822.php
+++ b/examples/transmission/rfc822.php
@@ -3,7 +3,7 @@ namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
//pull in API key config
-$configFile = file_get_contents(dirname(__FILE__) . "/../example-config.json");
+$configFile = file_get_contents(dirname(__FILE__) . '/../example-config.json');
$config = json_decode($configFile, true);
use SparkPost\SparkPost;
@@ -15,17 +15,17 @@ $sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]);
try {
$results = $sparky->transmission->send([
- 'recipients'=>[
- [
- 'address'=>[
- 'email'=>'john.doe@example.com'
+ 'recipients'=>[
+ [
+ 'address'=>[
+ 'email'=>'john.doe@example.com'
]
- ]
- ],
- 'rfc822'=>"Content-Type: text/plain\nFrom: From Envelope <from@sparkpostbox.com>\nSubject: Example Email\n\nHello World"
- ]);
- echo 'Congrats you can use your SDK!';
+ ]
+ ],
+ 'rfc822'=>'Content-Type: text/plain\nFrom: From Envelope <from@sparkpostbox.com>\nSubject: Example Email\n\nHello World'
+ ]);
+ echo 'Congrats you can use your SDK!';
} catch (\Exception $exception) {
- echo $exception->getMessage();
+ echo $exception->getMessage();
}
?>
diff --git a/examples/transmission/send_transmission_all_fields.php b/examples/transmission/send_transmission_all_fields.php
index bbd6f6b..749f0cb 100644
--- a/examples/transmission/send_transmission_all_fields.php
+++ b/examples/transmission/send_transmission_all_fields.php
@@ -3,7 +3,7 @@ namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
//pull in API key config
-$configFile = file_get_contents(dirname(__FILE__) . "/../example-config.json");
+$configFile = file_get_contents(dirname(__FILE__) . '/../example-config.json');
$config = json_decode($configFile, true);
use SparkPost\SparkPost;
@@ -15,36 +15,36 @@ $sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]);
try{
$results = $sparky->transmission->send([
- "campaign"=>"my-campaign",
- "metadata"=>[
- "sample_campaign"=>true,
- "type"=>"these are custom fields"
- ],
- "substitutionData"=>[
- "name"=>"Test Name"
- ],
- "description"=>"my description",
- "replyTo"=>"reply@test.com",
- "customHeaders"=>[
- "X-Custom-Header"=>"Sample Custom Header"
- ],
- "trackOpens"=>false,
- "trackClicks"=>false,
- "from"=>"From Envelope <from@sparkpostbox.com>",
- "html"=>"<p>Hello World! Your name is: {{name}}</p>",
- "text"=>"Hello World!",
- "subject"=>"Example Email: {{name}}",
- "recipients"=>[
- [
- "address"=>[
- "email"=>"john.doe@example.com"
+ 'campaign'=>'my-campaign',
+ 'metadata'=>[
+ 'sample_campaign'=>true,
+ 'type'=>'these are custom fields'
+ ],
+ 'substitutionData'=>[
+ 'name'=>'Test Name'
+ ],
+ 'description'=>'my description',
+ 'replyTo'=>'reply@test.com',
+ 'customHeaders'=>[
+ 'X-Custom-Header'=>'Sample Custom Header'
+ ],
+ 'trackOpens'=>false,
+ 'trackClicks'=>false,
+ 'from'=>'From Envelope <from@sparkpostbox.com>',
+ 'html'=>'<p>Hello World! Your name is: {{name}}</p>',
+ 'text'=>'Hello World!',
+ 'subject'=>'Example Email: {{name}}',
+ '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();
}
?>
diff --git a/examples/transmission/simple_send.php b/examples/transmission/simple_send.php
index 30b5c4e..5844ecc 100644
--- a/examples/transmission/simple_send.php
+++ b/examples/transmission/simple_send.php
@@ -3,7 +3,7 @@ namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
//pull in API key config
-$configFile = file_get_contents(dirname(__FILE__) . "/../example-config.json");
+$configFile = file_get_contents(dirname(__FILE__) . '/../example-config.json');
$config = json_decode($configFile, true);
use SparkPost\SparkPost;
@@ -15,20 +15,20 @@ $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"
+ 'from'=>'From Envelope <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();
}
?>
diff --git a/examples/transmission/stored_recipients_inline_content.php b/examples/transmission/stored_recipients_inline_content.php
index 8a30d7e..9348f9b 100644
--- a/examples/transmission/stored_recipients_inline_content.php
+++ b/examples/transmission/stored_recipients_inline_content.php
@@ -3,7 +3,7 @@ namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
//pull in API key config
-$configFile = file_get_contents(dirname(__FILE__) . "/../example-config.json");
+$configFile = file_get_contents(dirname(__FILE__) . '/../example-config.json');
$config = json_decode($configFile, true);
use SparkPost\SparkPost;
@@ -16,16 +16,16 @@ $sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]);
try {
$results = $sparky->transmission->send([
- "campaign"=>"my-campaign",
- "from"=>"From Envelope <from@sparkpostbox.com>",
- "html"=>"<p>Hello World! Your name is: {{name}}</p>",
- "text"=>"Hello World!",
- "subject"=>"Example Email: {{name}}",
- "recipientList"=>'Example List'
- ]);
+ 'campaign'=>'my-campaign',
+ 'from'=>'From Envelope <from@sparkpostbox.com>',
+ 'html'=>'<p>Hello World! Your name is: {{name}}</p>',
+ 'text'=>'Hello World!',
+ 'subject'=>'Example Email: {{name}}',
+ 'recipientList'=>'Example List'
+ ]);
- echo 'Congrats you can use your SDK!';
+ echo 'Congrats you can use your SDK!';
} catch (\Exception $exception) {
- echo $exception->getMessage();
+ echo $exception->getMessage();
}
?>
diff --git a/examples/transmission/stored_template_send.php b/examples/transmission/stored_template_send.php
index 5cf1cf3..2e22609 100644
--- a/examples/transmission/stored_template_send.php
+++ b/examples/transmission/stored_template_send.php
@@ -3,7 +3,7 @@ namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
//pull in API key config
-$configFile = file_get_contents(dirname(__FILE__) . "/../example-config.json");
+$configFile = file_get_contents(dirname(__FILE__) . '/../example-config.json');
$config = json_decode($configFile, true);
use SparkPost\SparkPost;
@@ -15,18 +15,18 @@ $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"
+ 'from'=>'From Envelope <from@sparkpostbox.com>',
+ 'recipients'=>[
+ [
+ 'address'=>[
+ 'email'=>'john.doe@example.com'
]
]
- ],
- "template"=>"my-first-email"
- ]);
- echo 'Congrats you can use your SDK!';
+ ],
+ 'template'=>'my-first-email'
+ ]);
+ echo 'Congrats you can use your SDK!';
} catch (\Exception $exception) {
- echo $exception->getMessage();
+ echo $exception->getMessage();
}
?>
diff --git a/examples/unwrapped/create_template.php b/examples/unwrapped/create_template.php
index d92b294..a3431d4 100644
--- a/examples/unwrapped/create_template.php
+++ b/examples/unwrapped/create_template.php
@@ -3,7 +3,7 @@ namespace Examples\Unwrapped;
require_once (dirname(__FILE__).'/../bootstrap.php');
//pull in API key config
-$configFile = file_get_contents(dirname(__FILE__) . "/../example-config.json");
+$configFile = file_get_contents(dirname(__FILE__) . '/../example-config.json');
$config = json_decode($configFile, true);
use SparkPost\SparkPost;
@@ -15,20 +15,20 @@ $sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]);
try {
// define the endpoint
- $sparky->setupUnwrapped('templates');
+ $sparky->setupUnwrapped('templates');
- $templateConfig = [
- 'name' => 'Summer Sale!',
+ $templateConfig = [
+ 'name' => 'Summer Sale!',
'id'=>'jordan-test-summer-sale',
- 'content'=> [
+ 'content'=> [
'from' => 'from@sparkpostbox.com',
- 'subject' => 'Summer deals',
- 'html' => '<b>Check out these deals!</b>'
+ 'subject' => 'Summer deals',
+ 'html' => '<b>Check out these deals!</b>'
]
- ];
- $results = $sparky->templates->create($templateConfig);
- echo 'Congrats you can use your SDK!';
+ ];
+ $results = $sparky->templates->create($templateConfig);
+ echo 'Congrats you can use your SDK!';
} catch (\Exception $exception) {
- echo $exception->getMessage();
+ echo $exception->getMessage();
}
?>