diff --git a/src/Mailgun/Messages/MessageBuilder.php b/src/Mailgun/Messages/MessageBuilder.php index d4aec4f..bf33269 100644 --- a/src/Mailgun/Messages/MessageBuilder.php +++ b/src/Mailgun/Messages/MessageBuilder.php @@ -338,6 +338,11 @@ class MessageBuilder } } + public function setMessage($message) + { + $this->message = $message; + } + public function getMessage() { return $this->message; diff --git a/tests/Mailgun/Tests/Messages/MessageBuilderTest.php b/tests/Mailgun/Tests/Messages/MessageBuilderTest.php index d81eed5..f056d83 100644 --- a/tests/Mailgun/Tests/Messages/MessageBuilderTest.php +++ b/tests/Mailgun/Tests/Messages/MessageBuilderTest.php @@ -254,6 +254,14 @@ class MessageBuilderTest extends \Mailgun\Tests\MailgunTestCase{ $messageObj = $message->getMessage(); $this->assertEquals(array("my-option" => array("yes"), "o:my-other-option" => array("no")), $messageObj); } + + public function testSetMessage(){ + $message = [1,2,3,4,5]; + $messageBuilder = $this->client->MessageBuilder(); + $messageBuilder->setMessage($message); + + $this->assertEquals($message, $messageBuilder->getMessage()); + } } ?> \ No newline at end of file