summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAvi Goldman <avrahamymgoldman@gmail.com>2016-06-20 11:26:43 -0400
committerGitHub <noreply@github.com>2016-06-20 11:26:43 -0400
commit87552cc2766f4ea8c8a2d6ff6c70dd74faecb687 (patch)
tree0d37219ce699bffd8adc0cd5fb7c5ec012c80df0 /examples
parenta5847be109dc6350fb0bc8beb8d0ba8bc23b75b6 (diff)
downloadphp-sparkpost-87552cc2766f4ea8c8a2d6ff6c70dd74faecb687.zip
php-sparkpost-87552cc2766f4ea8c8a2d6ff6c70dd74faecb687.tar.gz
php-sparkpost-87552cc2766f4ea8c8a2d6ff6c70dd74faecb687.tar.bz2
Merged FAD-3148 into 2.x
* FAD-3148 basic non-functioning base class * FAD-3148 a bit more functionality in the base class * FAD-3148 added custom promise class and custom response class. Did good things to SparkPost class * Updated Transmission.php for new refactor, still WIP. Created Resource.php as a parent class for all future resources. * Removed test functions * Cleaned up Transmissions.php according to PSR-2, deleted more test code and comments. * added sync and aysnc, cleaned up code * added support for async/sync option * added support for async/sync option * Added interns to authors * simplified the request function * added comments * added user agent * added comments in SparkPostPromise * added comments in SparkPostException * added comments in SparkPostResponse * cleaning up test * updated composer.json and contributing files for testing * Ran php-cs-fixer * testing for sparkpost response class * updated to newer version of guzzle * updated to newer version of guzzle * Cleaned up getUrl and other functions * cleaned up constructor and overrode getCode with getResponse()->getStatusCode() * fixed up then method * cleaned up getBody * deleted old test * Wrote total coverage tests for SparkPost class * commented out setting up transmissions endpoint until merging with FAD-3146
Diffstat (limited to 'examples')
-rw-r--r--examples/transmission/send_with_bcc.php8
-rw-r--r--examples/transmission/send_with_cc.php12
-rw-r--r--examples/unwrapped/create_transmission.php9
3 files changed, 14 insertions, 15 deletions
diff --git a/examples/transmission/send_with_bcc.php b/examples/transmission/send_with_bcc.php
index ce67862..7479c4a 100644
--- a/examples/transmission/send_with_bcc.php
+++ b/examples/transmission/send_with_bcc.php
@@ -36,8 +36,8 @@ try {
'email' => 'original.recipient@example.com',
],
'substitution_data' => [
- 'recipient_type' => 'Original'
- ]
+ 'recipient_type' => 'Original',
+ ],
],
[
'address' => [
@@ -45,8 +45,8 @@ try {
'header_to' => '"Original Recipient" <original.recipient@example.com>',
],
'substitution_data' => [
- 'recipient_type' => 'BCC'
- ]
+ 'recipient_type' => 'BCC',
+ ],
],
],
]);
diff --git a/examples/transmission/send_with_cc.php b/examples/transmission/send_with_cc.php
index fa1d9e9..7ad2a7b 100644
--- a/examples/transmission/send_with_cc.php
+++ b/examples/transmission/send_with_cc.php
@@ -36,8 +36,8 @@ try {
'email' => 'original.recipient@example.com',
],
'substitution_data' => [
- 'recipient_type' => 'Original'
- ]
+ 'recipient_type' => 'Original',
+ ],
],
[
'address' => [
@@ -46,13 +46,13 @@ try {
'header_to' => '"Original Recipient" <original.recipient@example.com>',
],
'substitution_data' => [
- 'recipient_type' => 'CC'
- ]
+ 'recipient_type' => 'CC',
+ ],
],
],
'customHeaders' => [
- 'CC' => '"Carbon Copy Recipient" <cc.recipient@example.com>'
- ]
+ 'CC' => '"Carbon Copy Recipient" <cc.recipient@example.com>',
+ ],
]);
echo 'Congrats! You sent an email with cc using SparkPost!';
} catch (\Exception $exception) {
diff --git a/examples/unwrapped/create_transmission.php b/examples/unwrapped/create_transmission.php
index f19ee6e..d3a44c5 100644
--- a/examples/unwrapped/create_transmission.php
+++ b/examples/unwrapped/create_transmission.php
@@ -24,8 +24,8 @@ try {
[
'address' => [
'email' => 'john.doe@example.com',
- ]
- ]
+ ],
+ ],
],
'content' => [
'from' => [
@@ -34,8 +34,8 @@ try {
],
'html' => '<p>Hello World!</p>',
'text' => 'Hello World!',
- 'subject' => 'Example Email'
- ]
+ 'subject' => 'Example Email',
+ ],
];
$results = $sparky->transmissions->create($message);
echo 'Congrats! You sent a message using SparkPost!';
@@ -44,4 +44,3 @@ try {
echo $exception->getAPICode()."\n";
echo $exception->getAPIDescription()."\n";
}
-