@@ -143,7 +143,7 @@ $sparky = new SparkPost($httpClient, ['key'=>'YOUR_API_KEY']);
143
143
* ` uri `
144
144
* Required: Yes
145
145
* Type: ` String `
146
- * The URI to recieve the request
146
+ * The URI to receive the request
147
147
* ` payload `
148
148
* Required: No
149
149
* Type: ` Array `
@@ -177,11 +177,11 @@ Sends an asynchronous request to the SparkPost API and returns a `SparkPostPromi
177
177
* ` payload.cc `
178
178
* Required: No
179
179
* Type: ` Array `
180
- * Recipients to recieve a carbon copy of the transmission
180
+ * Recipients to receive a carbon copy of the transmission
181
181
* ` payload.bcc `
182
182
* Required: No
183
183
* Type: ` Array `
184
- * Recipients to descreetly recieve a carbon copy of the transmission
184
+ * Recipients to discreetly receive a carbon copy of the transmission
185
185
186
186
## Examples
187
187
@@ -196,9 +196,8 @@ use Http\Adapter\Guzzle6\Client as GuzzleAdapter;
196
196
197
197
$httpClient = new GuzzleAdapter(new Client());
198
198
// Good practice to not have API key literals in code - set an environment variable instead
199
- $sparky = new SparkPost($httpClient, ['key' => getenv('SPARKPOST_API_KEY')]);
200
199
// For simple example, use synchronous model
201
- $sparky->setOptions([ 'async' => false]);
200
+ $sparky = new SparkPost($httpClient, ['key' => getenv('SPARKPOST_API_KEY'), 'async' => false]);
202
201
203
202
try {
204
203
$response = $sparky->transmissions->post([
@@ -299,7 +298,7 @@ The API calls either return a `SparkPostPromise` or `SparkPostResponse` dependin
299
298
``` php
300
299
$sparky->setOptions(['async' => false]);
301
300
try {
302
- $response = $sparky->transmissions->get(); //TODO: Change this. Transmissions no longer supports GET call
301
+ $response = $sparky->transmissions->get();
303
302
304
303
echo $response->getStatusCode()."\n";
305
304
print_r($response->getBody())."\n";
@@ -314,7 +313,8 @@ catch (\Exception $e) {
314
313
Asynchronous an be handled in two ways: by passing callbacks or waiting for the promise to be fulfilled. Waiting acts like synchronous request.
315
314
##### Wait (Synchronous)
316
315
``` php
317
- $promise = $sparky->transmissions->get(); //TODO: Change this. Transmissions no longer supports GET call
316
+
317
+ $promise = // YOUR API CALL GOES HERE
318
318
319
319
try {
320
320
$response = $promise->wait();
@@ -330,7 +330,7 @@ echo "I will print out after the promise is fulfilled";
330
330
331
331
##### Then (Asynchronous)
332
332
``` php
333
- $promise = $sparky->transmissions->get(); //TODO: Change this. Transmissions no longer supports GET call
333
+ $promise = // YOUR API CALL GOES HERE
334
334
335
335
$promise->then(
336
336
// Success callback
0 commit comments