Skip to content

Commit

Permalink
Version Bump: v6.0.0: PR #408: Update Mail constructor to signify whi…
Browse files Browse the repository at this point in the history
…ch parameters are required for sending all email
  • Loading branch information
thinkingserious committed Jul 1, 2017
1 parent e6f7c9e commit 8db454e
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 45 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](http://semver.org/).

## [6.0.0] - 2017-06-30 ##
### BREAKING CHANGE
- PR #408: Update Mail constructor to signify which parameters are required for sending all email
- The `Mail()` constructor now requires `$from`, `$subject`, `$to` and `$content` parameters like so: `Mail($from, $subject, $to, $content)`. Those are the minimaly required paramaters to send an email.
- Thanks to [Casey Wilson](https://github.com/caseyw) for the PR!

## [5.6.2] - 2017-06-29 ##
### Fix
- PR #410: Adding name for ReplyTo for issue #390
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Add SendGrid to your `composer.json` file. If you are not using [Composer](http:
```json
{
"require": {
"sendgrid/sendgrid": "~5.6"
"sendgrid/sendgrid": "~6.0"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sendgrid/sendgrid",
"description": "This library allows you to quickly and easily send emails through SendGrid using PHP.",
"version": "5.6.2",
"version": "6.0.0",
"homepage": "http://github.com/sendgrid/sendgrid-php",
"license": "MIT",
"keywords": ["SendGrid", "sendgrid", "email", "send", "grid"],
Expand Down
76 changes: 35 additions & 41 deletions examples/helpers/mail/example.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,61 +21,55 @@ function helloEmail()

function kitchenSink()
{
$mail = new Mail();

$email = new Email("DX", "test@example.com");
$mail->setFrom($email);
$from = new Email("DX", "[email protected]");
$subject = "Hello World from the SendGrid PHP Library";
$to = new Email("Example User", "test1@example.com");
$content = new Content("text/plain", "some text here");

$mail->setSubject("Hello World from the SendGrid PHP Library");
$mail = new Mail($from, $subject, $to, $content);

$personalization = new Personalization();
$email1 = new Email("Example User", "[email protected]");
$personalization->addTo($email1);
$email2 = new Email("Example User", "[email protected]");
$personalization->addTo($email2);
$mail->personalization[0]->addTo($email2);
$email3 = new Email("Example User", "[email protected]");
$personalization->addCc($email3);
$mail->personalization[0]->addCc($email3);
$email4 = new Email("Example User", "[email protected]");
$personalization->addCc($email4);
$mail->personalization[0]->addCc($email4);
$email5 = new Email("Example User", "[email protected]");
$personalization->addBcc($email5);
$mail->personalization[0]->addBcc($email5);
$email6 = new Email("Example User", "[email protected]");
$personalization->addBcc($email6);
$personalization->setSubject("Hello World from the SendGrid PHP Library");
$personalization->addHeader("X-Test", "test");
$personalization->addHeader("X-Mock", "true");
$personalization->addSubstitution("%name%", "Example User");
$personalization->addSubstitution("%city%", "Denver");
$personalization->addCustomArg("user_id", "343");
$personalization->addCustomArg("type", "marketing");
$personalization->setSendAt(1443636843);
$mail->addPersonalization($personalization);

$personalization2 = new Personalization();
$mail->personalization[0]->addBcc($email6);
$mail->personalization[0]->setSubject("Hello World from the SendGrid PHP Library");
$mail->personalization[0]->addHeader("X-Test", "test");
$mail->personalization[0]->addHeader("X-Mock", "true");
$mail->personalization[0]->addSubstitution("%name%", "Example User");
$mail->personalization[0]->addSubstitution("%city%", "Denver");
$mail->personalization[0]->addCustomArg("user_id", "343");
$mail->personalization[0]->addCustomArg("type", "marketing");
$mail->personalization[0]->setSendAt(1443636843);

$personalization1 = new Personalization();
$email7 = new Email("Example User", "[email protected]");
$personalization2->addTo($email7);
$personalization1->addTo($email7);
$email8 = new Email("Example User", "[email protected]");
$personalization2->addTo($email8);
$personalization1->addTo($email8);
$email9 = new Email("Example User", "[email protected]");
$personalization2->addCc($email9);
$personalization1->addCc($email9);
$email10 = new Email("Example User", "[email protected]");
$personalization2->addCc($email10);
$personalization1->addCc($email10);
$email11 = new Email("Example User", "[email protected]");
$personalization2->addBcc($email11);
$personalization1->addBcc($email11);
$email12 = new Email("Example User", "[email protected]");
$personalization2->addBcc($email12);
$personalization2->setSubject("Hello World from the SendGrid PHP Library");
$personalization2->addHeader("X-Test", "test");
$personalization2->addHeader("X-Mock", "true");
$personalization2->addSubstitution("%name%", "Example User");
$personalization2->addSubstitution("%city%", "Denver");
$personalization2->addCustomArg("user_id", "343");
$personalization2->addCustomArg("type", "marketing");
$personalization2->setSendAt(1443636843);
$mail->addPersonalization($personalization2);
$personalization1->addBcc($email12);
$personalization1->setSubject("Hello World from the SendGrid PHP Library");
$personalization1->addHeader("X-Test", "test");
$personalization1->addHeader("X-Mock", "true");
$personalization1->addSubstitution("%name%", "Example User");
$personalization1->addSubstitution("%city%", "Denver");
$personalization1->addCustomArg("user_id", "343");
$personalization1->addCustomArg("type", "marketing");
$personalization1->setSendAt(1443636843);
$mail->addPersonalization($personalization1);

$content = new Content("text/plain", "some text here");
$mail->addContent($content);
$content = new Content("text/html", "<html><body>some text here</body></html>");
$mail->addContent($content);

Expand Down
2 changes: 1 addition & 1 deletion lib/SendGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
class SendGrid
{
const VERSION = '5.6.2';
const VERSION = '6.0.0';

/**
*
Expand Down
2 changes: 1 addition & 1 deletion test/unit/SendGridTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function testHelloWorld()

public function testVersion()
{
$this->assertEquals(SendGrid::VERSION, '5.6.2');
$this->assertEquals(SendGrid::VERSION, '6.0.0');
$this->assertEquals(json_decode(file_get_contents(__DIR__ . '/../../composer.json'))->version, SendGrid::VERSION);
}

Expand Down

0 comments on commit 8db454e

Please sign in to comment.