diff --git a/CHANGELOG.md b/CHANGELOG.md index ee4a985..d60af4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 3.5.5 + +### Fixed +- Cast integer values to string for sending multipart data + ## 3.5.4 ### Added diff --git a/src/Api/Message.php b/src/Api/Message.php index f804a49..28333d9 100644 --- a/src/Api/Message.php +++ b/src/Api/Message.php @@ -16,6 +16,7 @@ use Mailgun\Exception\InvalidArgumentException; use Mailgun\Message\BatchMessage; use Mailgun\Model\Message\SendResponse; use Mailgun\Model\Message\ShowResponse; +use Psr\Http\Client\ClientExceptionInterface; use Psr\Http\Message\ResponseInterface; /** @@ -34,6 +35,7 @@ class Message extends HttpApi * @see https://documentation.mailgun.com/en/latest/api-sending.html#sending * * @return SendResponse|ResponseInterface + * @throws \Exception|ClientExceptionInterface */ public function send(string $domain, array $params) { @@ -164,6 +166,9 @@ class Message extends HttpApi foreach ($params as $key => $value) { // If $value is not an array we cast it to an array foreach ((array) $value as $subValue) { + if (is_int($subValue)) { + $subValue = (string)$subValue; + } $postDataMultipart[] = [ 'name' => $key, 'content' => $subValue,