summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authornornholdj <nornholdj@gmail.com>2014-11-14 16:25:36 -0500
committernornholdj <nornholdj@gmail.com>2014-11-14 16:25:36 -0500
commit2ca3b8764d9e7ad8c7436e53b6676e9eb6591f28 (patch)
tree6934c8cf3d9c91852a76e57314246e17c81b4f80 /examples
parent39f2699a7e7850397882a6d2ee3a8438a105b72d (diff)
parent3095de0dca14565911a2bdcc1ee5960e63b9b1f4 (diff)
downloadphp-sparkpost-2ca3b8764d9e7ad8c7436e53b6676e9eb6591f28.zip
php-sparkpost-2ca3b8764d9e7ad8c7436e53b6676e9eb6591f28.tar.gz
php-sparkpost-2ca3b8764d9e7ad8c7436e53b6676e9eb6591f28.tar.bz2
Merge branch 'feature/MA-1084' into develop
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.php24
-rw-r--r--examples/transmission/send_transmission_all_fields.php38
-rw-r--r--examples/transmission/simple_send.php (renamed from examples/transmission/configuration_based.php)23
-rw-r--r--examples/transmission/stored_recipients_inline_content.php10
-rw-r--r--examples/transmission/stored_template_send.php22
7 files changed, 64 insertions, 65 deletions
diff --git a/examples/transmission/get_all_transmissions.php b/examples/transmission/get_all_transmissions.php
index 754a6fc..db06b68 100644
--- a/examples/transmission/get_all_transmissions.php
+++ b/examples/transmission/get_all_transmissions.php
@@ -2,11 +2,11 @@
namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
-use MessageSystems\SparkPost;
-use MessageSystems\Transmission;
+use SparkPost\SparkPost;
+use SparkPost\Transmission;
$key = 'YOURAPIKEY';
-SparkPost::setConfig(['key'=>$key]);
+SparkPost::setConfig(array('key'=>$key));
try {
$results = Transmission::all();
diff --git a/examples/transmission/get_transmission.php b/examples/transmission/get_transmission.php
index b85d814..574388c 100644
--- a/examples/transmission/get_transmission.php
+++ b/examples/transmission/get_transmission.php
@@ -1,11 +1,11 @@
<?php
namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
-use MessageSystems\SparkPost;
-use MessageSystems\Transmission;
+use SparkPost\SparkPost;
+use SparkPost\Transmission;
$key = 'YOURAPIKEY';
-SparkPost::setConfig(['key'=>$key]);
+SparkPost::setConfig(array('key'=>$key));
try {
$results = Transmission::find('Your Transmission Id');
diff --git a/examples/transmission/rfc822.php b/examples/transmission/rfc822.php
index 1927382..b97bbb9 100644
--- a/examples/transmission/rfc822.php
+++ b/examples/transmission/rfc822.php
@@ -1,23 +1,23 @@
<?php
namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
-use MessageSystems\SparkPost;
-use MessageSystems\Transmission;
+use SparkPost\SparkPost;
+use SparkPost\Transmission;
$key = 'YOURAPIKEY';
-SparkPost::setConfig(['key'=>$key]);
+SparkPost::setConfig(array('key'=>$key));
try {
- $results = Transmission::send([
- 'recipients'=>[
- [
- 'address'=>[
+ $results = Transmission::send(array(
+ 'recipients'=>array(
+ array(
+ 'address'=>array(
'email'=>'john.doe@sample.com'
- ]
- ]
- ],
- 'rfc822Part'=>"Content-Type: text/plain\nFrom: From Envelope <from@example.com>\nSubject: Example Email\n\nHello World"
- ]);
+ )
+ )
+ ),
+ 'rfc822'=>"Content-Type: text/plain\nFrom: From Envelope <from@example.com>\nSubject: Example Email\n\nHello World"
+ ));
echo 'Congrats you can use your SDK!';
} catch (\Exception $exception) {
echo $exception->getMessage();
diff --git a/examples/transmission/send_transmission_all_fields.php b/examples/transmission/send_transmission_all_fields.php
index 6064e67..30f7793 100644
--- a/examples/transmission/send_transmission_all_fields.php
+++ b/examples/transmission/send_transmission_all_fields.php
@@ -1,41 +1,41 @@
<?php
namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
-use MessageSystems\SparkPost;
-use MessageSystems\Transmission;
+use SparkPost\SparkPost;
+use SparkPost\Transmission;
$key = 'YOURAPIKEY';
-SparkPost::setConfig(['key'=>$key]);
+SparkPost::setConfig(array('key'=>$key));
try{
- $results = Transmission::send([
+ $results = Transmission::send(array(
"campaign"=>"my-campaign",
- "metadata"=>[
+ "metadata"=>array(
"sample_campaign"=>true,
"type"=>"these are custom fields"
- ],
- "substitutionData"=>[
+ ),
+ "substitutionData"=>array(
"name"=>"Test Name"
- ],
+ ),
"description"=>"my description",
"replyTo"=>"reply@test.com",
- "headers"=>[
+ "customHeaders"=>array(
"X-Custom-Header"=>"Sample Custom Header"
- ],
- "openTracking"=>false,
- "clickTracking"=>false,
+ ),
+ "trackOpens"=>false,
+ "trackClicks"=>false,
"from"=>"From Envelope <from@example.com>",
"html"=>"<p>Hello World! Your name is: {{name}}</p>",
"text"=>"Hello World!",
"subject"=>"Example Email: {{name}}",
- "recipients"=>[
- [
- "address"=>[
+ "recipients"=>array(
+ array(
+ "address"=>array(
"email"=>"john.doe@sample.com"
- ]
- ]
- ]
- ]);
+ )
+ )
+ )
+ ));
echo 'Congrats you can use your SDK!';
} catch (\Exception $exception) {
echo $exception->getMessage();
diff --git a/examples/transmission/configuration_based.php b/examples/transmission/simple_send.php
index 157d3f3..8149238 100644
--- a/examples/transmission/configuration_based.php
+++ b/examples/transmission/simple_send.php
@@ -2,27 +2,26 @@
namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
-use MessageSystems\SparkPost;
-use MessageSystems\Transmission;
+use SparkPost\SparkPost;
+use SparkPost\Transmission;
$key = 'YOURAPIKEY';
-SparkPost::setConfig(['key'=>$key]);
+SparkPost::setConfig(array('key'=>$key));
try {
- $results = Transmission::send([
- "returnPath"=>"return@example.com",
+ $results = Transmission::send(array(
"from"=>"From Envelope <from@example.com>",
"html"=>"<p>Hello World!</p>",
"text"=>"Hello World!",
"subject"=>"Example Email",
- "recipients"=>[
- [
- "address"=>[
+ "recipients"=>array(
+ array(
+ "address"=>array(
"email"=>"john.doe@example.com"
- ]
- ]
- ]
- ]);
+ )
+ )
+ )
+ ));
echo 'Congrats you can use your SDK!';
} catch (\Exception $exception) {
echo $exception->getMessage();
diff --git a/examples/transmission/stored_recipients_inline_content.php b/examples/transmission/stored_recipients_inline_content.php
index f09ca63..dbb7c1d 100644
--- a/examples/transmission/stored_recipients_inline_content.php
+++ b/examples/transmission/stored_recipients_inline_content.php
@@ -1,22 +1,22 @@
<?php
namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
-use MessageSystems\SparkPost;
-use MessageSystems\Transmission;
+use SparkPost\SparkPost;
+use SparkPost\Transmission;
$key = 'YOURAPIKEY';
-SparkPost::setConfig(['key'=>$key]);
+SparkPost::setConfig(array('key'=>$key));
try {
- $results = Transmission::send([
+ $results = Transmission::send(array(
"campaign"=>"my-campaign",
"from"=>"From Envelope <from@example.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!';
} catch (\Exception $exception) {
diff --git a/examples/transmission/stored_template_send.php b/examples/transmission/stored_template_send.php
index 298ba69..cda6de6 100644
--- a/examples/transmission/stored_template_send.php
+++ b/examples/transmission/stored_template_send.php
@@ -1,24 +1,24 @@
<?php
namespace Examples\Transmisson;
require_once (dirname(__FILE__).'/../bootstrap.php');
-use MessageSystems\SparkPost;
-use MessageSystems\Transmission;
+use SparkPost\SparkPost;
+use SparkPost\Transmission;
$key = 'YOURAPIKEY';
-SparkPost::setConfig(['key'=>$key]);
+SparkPost::setConfig(array('key'=>$key));
try {
- $results = Transmission::send([
+ $results = Transmission::send(array(
"from"=>"From Envelope <from@example.com>",
- "recipients"=>[
- [
- "address"=>[
+ "recipients"=>array(
+ array(
+ "address"=>array(
"email"=>"john.doe@sample.com"
- ]
- ]
- ],
+ )
+ )
+ ),
"template"=>"my-template"
- ]);
+ ));
echo 'Congrats you can use your SDK!';
} catch (\Exception $exception) {
echo $exception->getMessage();