mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-25 14:26:04 +03:00
Merge pull request #19 from travelton/messageids
BatchMessage Improvements
This commit is contained in:
commit
82d17b5b6f
@ -84,12 +84,15 @@ class BatchMessage extends MessageBuilder{
|
||||
$this->counters['recipients']['bcc'] = 0;
|
||||
unset($this->message["to"]);
|
||||
array_push($this->messageIds, $response->http_response_body->id);
|
||||
return $this->messageIds;
|
||||
}
|
||||
}
|
||||
|
||||
public function finalize(){
|
||||
return $this->sendMessage();
|
||||
}
|
||||
|
||||
public function getMessageIds(){
|
||||
return $this->messageIds;
|
||||
}
|
||||
}
|
||||
?>
|
@ -105,6 +105,16 @@ class BatchMessageTest extends \Mailgun\Tests\MailgunTestCase{
|
||||
$propertyValue = $property->getValue($message);
|
||||
$this->assertEquals(1, $propertyValue['test-user@samples.mailgun.org']['id']);
|
||||
}
|
||||
public function testgetMessageIds() {
|
||||
$message = $this->client->BatchMessage($this->sampleDomain);
|
||||
$message->addToRecipient("test-user@samples.mailgun.org", array("first" => "Test", "last" => "User"));
|
||||
$message->setFromAddress("samples@mailgun.org", array("first" => "Test", "last" => "User"));
|
||||
$message->setSubject("This is the subject of the message!");
|
||||
$message->setTextBody("This is the text body of the message!");
|
||||
$message->finalize();
|
||||
|
||||
$this->assertEquals(array("1234"), $message->getMessageIds());
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user