mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-26 06:46:08 +03:00
Added message id return to batch sending.
This commit is contained in:
parent
0cabcece33
commit
24e6a01651
@ -17,6 +17,7 @@ class BatchMessage extends MessageBuilder{
|
||||
private $autoSend;
|
||||
private $restClient;
|
||||
private $workingDomain;
|
||||
private $messageIds = array();
|
||||
|
||||
public function __construct($restClient, $workingDomain, $autoSend){
|
||||
$this->batchRecipientAttributes = array();
|
||||
@ -63,7 +64,8 @@ class BatchMessage extends MessageBuilder{
|
||||
$this->batchRecipientAttributes = array();
|
||||
$this->toRecipientCount = 0;
|
||||
unset($this->message["to"]);
|
||||
return $response;
|
||||
array_push($this->messageIds, $response->http_response_body->id);
|
||||
return $this->messageIds;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ class TestBroker extends RestClient{
|
||||
if($httpResponseCode === 200){
|
||||
$result = new \stdClass();
|
||||
$result->http_response_body = new \stdClass();
|
||||
$jsonResponseData = json_decode('{"message": "Some JSON Response Data"}');
|
||||
$jsonResponseData = json_decode('{"message": "Some JSON Response Data", "id": "1234"}');
|
||||
foreach($jsonResponseData as $key => $value){
|
||||
$result->http_response_body->$key = $value;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user