diff options
author | nornholdj <nornholdj@gmail.com> | 2014-11-03 13:30:26 -0500 |
---|---|---|
committer | nornholdj <nornholdj@gmail.com> | 2014-11-03 13:30:26 -0500 |
commit | e034d061eba2d98e7751ae7153944dd579d8a4df (patch) | |
tree | ee783398f657287c7d0860a41ccd6d9eaa011771 /examples | |
parent | 68a7e8ec33f205a71107d924e0d244f5edac97a6 (diff) | |
download | php-sparkpost-e034d061eba2d98e7751ae7153944dd579d8a4df.zip php-sparkpost-e034d061eba2d98e7751ae7153944dd579d8a4df.tar.gz php-sparkpost-e034d061eba2d98e7751ae7153944dd579d8a4df.tar.bz2 |
MA-946 #time 2h updated defaults, readme documentation, and fixed
formatting in examples
Diffstat (limited to 'examples')
-rw-r--r-- | examples/transmission/configuration_based.php | 52 | ||||
-rw-r--r-- | examples/transmission/get_all_transmissions.php | 28 | ||||
-rw-r--r-- | examples/transmission/get_transmission.php | 10 | ||||
-rw-r--r-- | examples/transmission/rfc822.php | 10 | ||||
-rw-r--r-- | examples/transmission/stored_recipients_inline_content.php | 10 | ||||
-rw-r--r-- | examples/transmission/stored_template_send.php | 10 |
6 files changed, 59 insertions, 61 deletions
diff --git a/examples/transmission/configuration_based.php b/examples/transmission/configuration_based.php index 366434f..7f93b05 100644 --- a/examples/transmission/configuration_based.php +++ b/examples/transmission/configuration_based.php @@ -1,32 +1,32 @@ <?php namespace Examples\Transmisson; - require_once (dirname(__FILE__).'/../bootstrap.php'); +require_once (dirname(__FILE__).'/../bootstrap.php'); - use MessageSystems\SparkPost; - use MessageSystems\Transmission; +use MessageSystems\SparkPost; +use MessageSystems\Transmission; - $key = 'YOURAPIKEY'; - SparkPost::setConfig(['key'=>$key]); +$key = 'YOURAPIKEY'; +SparkPost::setConfig(['key'=>$key]); + +try { + $results = Transmission::send([ + "returnPath"=>"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@example.com" + ] + ] + ] + ]); + echo 'Congrats you can use your SDK!'; - try { - $results = Transmission::send([ - "returnPath"=>"return@example.com", - "from"=>"From Envelope <from@example.com>", - "html"=>"<p>Hello World!</p>", - "text"=>"Hello World!", - "subject"=>"Example Email", - "recipients"=>[ - [ - "address"=>[ - "email"=>"jordan.nornhold@rackspace.messagesystems.com" - ] - ] - ] - ]); - echo 'Congrats you can use your SDK!'; - - var_dump(Transmission::$structure); - } catch (\Exception $exception) { - echo $exception->getMessage(); - } + var_dump(Transmission::$structure); +} catch (\Exception $exception) { + echo $exception->getMessage(); +} ?>
\ No newline at end of file diff --git a/examples/transmission/get_all_transmissions.php b/examples/transmission/get_all_transmissions.php index 1425e65..754a6fc 100644 --- a/examples/transmission/get_all_transmissions.php +++ b/examples/transmission/get_all_transmissions.php @@ -1,17 +1,17 @@ <?php namespace Examples\Transmisson; - require_once (dirname(__FILE__).'/../bootstrap.php'); - - use MessageSystems\SparkPost; - use MessageSystems\Transmission; - - $key = 'YOURAPIKEY'; - SparkPost::setConfig(['key'=>$key]); - - try { - $results = Transmission::all(); - echo 'Congrats you can use your SDK!'; - } catch (\Exception $exception) { - echo $exception->getMessage(); - } +require_once (dirname(__FILE__).'/../bootstrap.php'); + +use MessageSystems\SparkPost; +use MessageSystems\Transmission; + +$key = 'YOURAPIKEY'; +SparkPost::setConfig(['key'=>$key]); + +try { + $results = Transmission::all(); + echo 'Congrats you can use your SDK!'; +} catch (\Exception $exception) { + echo $exception->getMessage(); +} ?>
\ No newline at end of file diff --git a/examples/transmission/get_transmission.php b/examples/transmission/get_transmission.php index 55cfe79..b85d814 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; - - $key = 'YOURAPIKEY'; - SparkPost::setConfig(['key'=>$key]); +use MessageSystems\SparkPost; +use MessageSystems\Transmission; + +$key = 'YOURAPIKEY'; +SparkPost::setConfig(['key'=>$key]); try { $results = Transmission::find('Your Transmission Id'); diff --git a/examples/transmission/rfc822.php b/examples/transmission/rfc822.php index e2b7353..1927382 100644 --- a/examples/transmission/rfc822.php +++ b/examples/transmission/rfc822.php @@ -1,11 +1,11 @@ <?php namespace Examples\Transmisson; require_once (dirname(__FILE__).'/../bootstrap.php'); - use MessageSystems\SparkPost; - use MessageSystems\Transmission; - - $key = 'YOURAPIKEY'; - SparkPost::setConfig(['key'=>$key]); +use MessageSystems\SparkPost; +use MessageSystems\Transmission; + +$key = 'YOURAPIKEY'; +SparkPost::setConfig(['key'=>$key]); try { $results = Transmission::send([ diff --git a/examples/transmission/stored_recipients_inline_content.php b/examples/transmission/stored_recipients_inline_content.php index a545122..f09ca63 100644 --- a/examples/transmission/stored_recipients_inline_content.php +++ b/examples/transmission/stored_recipients_inline_content.php @@ -1,13 +1,11 @@ <?php namespace Examples\Transmisson; require_once (dirname(__FILE__).'/../bootstrap.php'); - use MessageSystems\SparkPost; - use MessageSystems\Transmission; - - $key = 'YOURAPIKEY'; - SparkPost::setConfig(['key'=>$key]); - +use MessageSystems\SparkPost; +use MessageSystems\Transmission; +$key = 'YOURAPIKEY'; +SparkPost::setConfig(['key'=>$key]); try { diff --git a/examples/transmission/stored_template_send.php b/examples/transmission/stored_template_send.php index 4d58c70..298ba69 100644 --- a/examples/transmission/stored_template_send.php +++ b/examples/transmission/stored_template_send.php @@ -1,11 +1,11 @@ <?php namespace Examples\Transmisson; require_once (dirname(__FILE__).'/../bootstrap.php'); - use MessageSystems\SparkPost; - use MessageSystems\Transmission; - - $key = 'YOURAPIKEY'; - SparkPost::setConfig(['key'=>$key]); +use MessageSystems\SparkPost; +use MessageSystems\Transmission; + +$key = 'YOURAPIKEY'; +SparkPost::setConfig(['key'=>$key]); try { $results = Transmission::send([ |