Added message id return to batch sending.

This commit is contained in:
Travis Swientek 2013-08-21 23:05:18 -07:00
parent 0cabcece33
commit 24e6a01651
2 changed files with 4 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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;
}