diff --git a/CHANGELOG.md b/CHANGELOG.md index 0eb15ea..f53b148 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Changed + +- Add `Accept: application/json` header in request to fix incompatibility with 3rd party providers + ## 1.8.0 ### Added diff --git a/src/Input/SendEmailRequest.php b/src/Input/SendEmailRequest.php index a7b642d..d6d8f87 100644 --- a/src/Input/SendEmailRequest.php +++ b/src/Input/SendEmailRequest.php @@ -234,7 +234,10 @@ public function getReplyToAddresses(): array public function request(): Request { // Prepare headers - $headers = ['content-type' => 'application/json']; + $headers = [ + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + ]; // Prepare query $query = []; diff --git a/tests/Unit/Input/SendEmailRequestTest.php b/tests/Unit/Input/SendEmailRequestTest.php index 0c86c81..3f0fb40 100644 --- a/tests/Unit/Input/SendEmailRequestTest.php +++ b/tests/Unit/Input/SendEmailRequestTest.php @@ -45,7 +45,8 @@ public function testRequest(): void // see example-1.json from SDK $expected = ' POST /v2/email/outbound-emails HTTP/1.0 - Content-Type: application/json + Content-type: application/json + Accept: application/json { "FromEmailAddress": "jeremy@derusse.com",