mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-02-18 05:43:15 +03:00
Add fix to handle integers values and cast them to string. Because only string is allowed
This commit is contained in:
parent
62bd235af7
commit
8c3840a1eb
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user