mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-02-06 08:19:25 +03:00
Merge pull request #57 from jchamberlain/custom-data
Allow any data type for custom data
This commit is contained in:
commit
24085530d9
@ -314,15 +314,7 @@ class MessageBuilder
|
||||
|
||||
public function addCustomData($customName, $data)
|
||||
{
|
||||
if (is_array($data)) {
|
||||
$jsonArray = json_encode($data);
|
||||
$this->message['v:' . $customName] = $jsonArray;
|
||||
|
||||
return $this->message['v:' . $customName];
|
||||
} else {
|
||||
throw new InvalidParameter(INVALID_PARAMETER_NON_ARRAY);
|
||||
}
|
||||
|
||||
$this->message['v:' . $customName] = json_encode($data);
|
||||
}
|
||||
|
||||
public function addCustomParameter($parameterName, $data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user