Skip to content

Commit

Permalink
Merge pull request #494 from myzeprog/492-review-request-body-trouble…
Browse files Browse the repository at this point in the history
…shooting

Update TROUBLESHOOTING.md
  • Loading branch information
Matt Bernier authored Oct 20, 2017
2 parents 69d751d + d8942f2 commit de3f847
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ If you can't find a solution below, please open an [issue](https://github.com/se
* [Environment Variables and Your SendGrid API Key](#environment)
* [Using the Package Manager](#package-manager)
* [Fixing Error 415](#error-415)
* [Viewing the Request Body](#request-body)

<a name="migrating"></a>
## Migrating from v2 to v3
Expand Down Expand Up @@ -99,3 +100,14 @@ If you're getting the following error while using this library:
It is most likely due to a linebreak in your API key. Passing your key through `trim` should fix this:

`$apiKey = trim($apiKey)`

<a name="request-body"></a>
## Viewing the Request Body

When debugging or testing, it may be useful to examine the raw request body to compare against the [documented format](https://sendgrid.com/docs/API_Reference/api_v3.html).

You can do this right before you call `$response = $sg->client->mail()->send()->post($mail);` like so:

```php
echo json_encode($mail, JSON_PRETTY_PRINT);
```

0 comments on commit de3f847

Please sign in to comment.