Skip to content

Commit

Permalink
Relaxed Guzzle requirement, fixed reply-to bug, updated point release…
Browse files Browse the repository at this point in the history
… version. Fixes #7 Fixes #9
  • Loading branch information
Travis Swientek committed Sep 12, 2013
1 parent ef0c1b8 commit 116fb33
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).**
Expand Down
4 changes: 2 additions & 2 deletions SharedHostInstall.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.*"
Expand Down
3 changes: 3 additions & 0 deletions src/Mailgun/Messages/MessageBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ protected function addRecipient($headerName, $address, $variables){
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);
}
Expand Down
6 changes: 6 additions & 0 deletions tests/Mailgun/Tests/Messages/MessageBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public function testSetFromAddress(){
$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");
Expand Down

0 comments on commit 116fb33

Please sign in to comment.