diff --git a/src/Mailgun/Messages/BatchMessage.php b/src/Mailgun/Messages/BatchMessage.php index 332a0df..1e54036 100644 --- a/src/Mailgun/Messages/BatchMessage.php +++ b/src/Mailgun/Messages/BatchMessage.php @@ -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; } } diff --git a/tests/Mailgun/Tests/Connection/TestBroker.php b/tests/Mailgun/Tests/Connection/TestBroker.php index 08ea168..234fb4b 100644 --- a/tests/Mailgun/Tests/Connection/TestBroker.php +++ b/tests/Mailgun/Tests/Connection/TestBroker.php @@ -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; }