Relaxed Guzzle requirement, fixed reply-to bug, updated point release version. Fixes #7 Fixes #9

This commit is contained in:
Travis Swientek 2013-09-12 14:19:23 -07:00
parent ef0c1b856a
commit 116fb33255
5 changed files with 13 additions and 4 deletions

View File

@ -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).**

View File

@ -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.

View File

@ -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.*"

View File

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

View File

@ -38,6 +38,12 @@ class MessageBuilderTest extends \Mailgun\Tests\MailgunTestCase{
$messageObj = $message->getMessage();
$this->assertEquals(array("from" => array("'Test User' <test@samples.mailgun.org>")), $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' <test@samples.mailgun.org>"), $messageObj);
}
public function testSetSubject(){
$message = $this->client->MessageBuilder();
$message->setSubject("Test Subject");