diff --git a/README.md b/README.md index 0b86d9e..e5c25be 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ composer and the Mailgun SDK. curl -sS https://getcomposer.org/installer | php # Add Mailgun as a dependency -php composer.phar require mailgun/mailgun-php:~1.2 +php composer.phar require mailgun/mailgun-php:~1.3 ``` **For shared hosts without SSH access, check out our [Shared Host Instructions](SharedHostInstall.md).** diff --git a/SharedHostInstall.md b/SharedHostInstall.md index b0372a7..ab0d02f 100644 --- a/SharedHostInstall.md +++ b/SharedHostInstall.md @@ -11,7 +11,7 @@ Linux / Mac OSX: *PHP is typically installed by default, consult your distribution documentation. Instructions from [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix).* 1. curl -sS https://getcomposer.org/installer | php -2. php composer.phar require mailgun/mailgun-php:~1.2 +2. php composer.phar require mailgun/mailgun-php:~1.3 3. The files will be downloaded to your local computer. 4. Upload the files to your webserver. @@ -20,7 +20,7 @@ Windows: *PHP must be installed on your computer, [download](http://windows.php.net/download/0). Instructions from [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-windows).* 1. Download and run [Composer-Setup.exe](https://getcomposer.org/Composer-Setup.exe). -2. Open a Command Prompt and type "php composer require mailgun/mailgun-php:~1.2". +2. Open a Command Prompt and type "php composer require mailgun/mailgun-php:~1.3". 3. The files will be downloaded to your local computer. 4. Upload the files to your webserver. diff --git a/composer.json b/composer.json index 6a5c1aa..8eac3e3 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "mailgun/mailgun-php", "description": "The Mailgun SDK provides methods for all API functions.", "require": { - "guzzle/guzzle": "3.7.1" + "guzzle/guzzle": "3.7.*" }, "require-dev": { "phpunit/phpunit": "3.7.*" diff --git a/src/Mailgun/Messages/MessageBuilder.php b/src/Mailgun/Messages/MessageBuilder.php index 142da6f..8f96e2d 100644 --- a/src/Mailgun/Messages/MessageBuilder.php +++ b/src/Mailgun/Messages/MessageBuilder.php @@ -64,6 +64,9 @@ class MessageBuilder{ if(isset($this->message[$headerName])){ array_push($this->message[$headerName], $compiledAddress); } + elseif($headerName == "h:reply-to"){ + $this->message[$headerName] = $compiledAddress; + } else{ $this->message[$headerName] = array($compiledAddress); } diff --git a/tests/Mailgun/Tests/Messages/MessageBuilderTest.php b/tests/Mailgun/Tests/Messages/MessageBuilderTest.php index f8e3a2f..c73d4a6 100644 --- a/tests/Mailgun/Tests/Messages/MessageBuilderTest.php +++ b/tests/Mailgun/Tests/Messages/MessageBuilderTest.php @@ -38,6 +38,12 @@ class MessageBuilderTest extends \Mailgun\Tests\MailgunTestCase{ $messageObj = $message->getMessage(); $this->assertEquals(array("from" => array("'Test User' ")), $messageObj); } + public function testSetReplyTo(){ + $message = $this->client->MessageBuilder(); + $message->setReplyToAddress("test@samples.mailgun.org", array("first" => "Test", "last" => "User")); + $messageObj = $message->getMessage(); + $this->assertEquals(array("h:reply-to" => "'Test User' "), $messageObj); + } public function testSetSubject(){ $message = $this->client->MessageBuilder(); $message->setSubject("Test Subject");