diff options
author | Avi Goldman <avrahamymgoldman@gmail.com> | 2016-06-23 09:43:56 -0400 |
---|---|---|
committer | Avi Goldman <avrahamymgoldman@gmail.com> | 2016-06-23 09:43:56 -0400 |
commit | f79318aeea95c0ce7fb8d5ef376a2b0b97f3c140 (patch) | |
tree | 60c4073730c4870404717d2ed3b152bc899371c1 /examples/transmissions/create_transmission_with_cc_and_bcc.php | |
parent | fda0a912a79ef6a7e5ea95123bd305fb712f80db (diff) | |
download | php-sparkpost-f79318aeea95c0ce7fb8d5ef376a2b0b97f3c140.zip php-sparkpost-f79318aeea95c0ce7fb8d5ef376a2b0b97f3c140.tar.gz php-sparkpost-f79318aeea95c0ce7fb8d5ef376a2b0b97f3c140.tar.bz2 |
fixed examples, and small details
Diffstat (limited to 'examples/transmissions/create_transmission_with_cc_and_bcc.php')
-rw-r--r-- | examples/transmissions/create_transmission_with_cc_and_bcc.php | 52 |
1 files changed, 33 insertions, 19 deletions
diff --git a/examples/transmissions/create_transmission_with_cc_and_bcc.php b/examples/transmissions/create_transmission_with_cc_and_bcc.php index 4c12f81..4c3e12b 100644 --- a/examples/transmissions/create_transmission_with_cc_and_bcc.php +++ b/examples/transmissions/create_transmission_with_cc_and_bcc.php @@ -10,39 +10,53 @@ use Http\Adapter\Guzzle6\Client as GuzzleAdapter; $httpClient = new GuzzleAdapter(new Client()); -/** +/* * configure options in example-options.json */ $sparky = new SparkPost($httpClient, $options); $promise = $sparky->transmissions->post([ - 'content' => [ - 'from'=> [ + 'content' => [ + 'from' => [ 'name' => 'SparkPost Team', - 'email' => 'from@sparkpostbox.com' + 'email' => 'from@sparkpostbox.com', ], - 'subject'=>'First Mailing From PHP', - 'html'=>'<html><body><h1>Congratulations, {{name}}!</h1><p>You just sent your very first mailing!</p></body></html>', - 'text'=>'Congratulations, {{name}}!! You just sent your very first mailing!' + 'subject' => 'First Mailing From PHP', + 'html' => '<html><body><h1>Congratulations, {{name}}!</h1><p>You just sent your very first mailing!</p></body></html>', + 'text' => 'Congratulations, {{name}}!! You just sent your very first mailing!', ], - 'substitution_data'=> ['name'=>'YOUR_FIRST_NAME'], - 'recipients'=> [ - [ 'address' => 'YOUR_NAME <YOUR_EMAIL>' ] + 'substitution_data' => ['name' => 'YOUR_FIRST_NAME'], + 'recipients' => [ + [ + 'address' => [ + 'name' => 'YOUR_NAME', + 'email' => 'YOUR_EMAIL', + ], + ], + ], + 'cc' => [ + [ + 'address' => [ + 'name' => 'ANOTHER_NAME', + 'email' => 'ANOTHER_EMAIL', + ], + ], ], - 'cc'=> [ - [ 'address' => 'ANOTHER_NAME <ANOTHER_EMAIL>' ] + 'bcc' => [ + [ + 'address' => [ + 'name' => 'AND_ANOTHER_NAME', + 'email' => 'AND_ANOTHER_EMAIL', + ], + ], ], - 'bcc'=> [ - [ 'address' => 'AND_ANOTHER_NAME <AND_ANOTHER_EMAIL>' ] - ] ]); try { $response = $promise->wait(); - echo $response->getStatusCode() . "\n"; + echo $response->getStatusCode()."\n"; print_r($response->getBody()); } catch (Exception $e) { - echo $e->getCode() . "\n"; - echo $e->getMessage() . "\n"; + echo $e->getCode()."\n"; + echo $e->getMessage()."\n"; } -?>
\ No newline at end of file |