Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'prerelease' of github.com:cjbuchmann/sendgrid-php into …

…prerelease
  • Loading branch information...
commit 0a5e73a20b1992209654545984889bf4d936e4fc 2 parents 9b75b71 + 16158e6
CJ Buchmann authored
Showing with 12 additions and 11 deletions.
  1. +12 −11 README.md
View
23 README.md
@@ -18,35 +18,36 @@ This library implements a common interface to make it very easy to use either AP
## Mail Pre-Usage ##
Before we begin using the library, its important to understand a few things about the library architecture...
-a. The SendGrid Mail object is the primary means of setting mail data. Its composed of many useful ways of setting data. In general, data can be set in three ways for most elements:
+
+* The SendGrid Mail object is the primary means of setting mail data. Its composed of many useful ways of setting data. In general, data can be set in three ways for most elements:
1. Set - reset the data, and initialize it to the given element. This will destroy previous data
- 2. SetList - for array based elements, we provide a way of passing the entire array in at once
+ 2. SetList - for array based elements, we provide a way of passing the entire array in at once. This will also destroy previous data.
3. add - for array based elements, you can append data to the list.
-b. We have two transport mechanisms for sending mail, SMTP and WEB. The WEB does not implement a common REST interface, since it does not make use of GET, PUT, POST, DELETE. Instead, its REST-like, allowing GET and POST elements, simultaneously. In general, the differences and nuances between these transport mechanisms have been extracted to provide a more fluid interface.
+* We have two transport mechanisms for sending mail, SMTP and WEB. The WEB does not implement a common REST interface, since it does not make use of GET, PUT, POST, DELETE. Instead, its REST-like, allowing GET and POST elements, simultaneously. In general, the differences and nuances between these transport mechanisms have been extracted to provide a more fluid interface, and these finer details won't affect most users.
-c. Sending an email is as simple as :
+* Sending an email is as simple as :
1. Creating a SendGrid Library Instance
- 2. Creating a SendGrid Mail object, and setting its data
- 3. Sending the mail using either SMTP or Web.
+ 1. Creating a SendGrid Mail object, and setting its data
+ 1. Sending the mail using either SMTP or Web.
## Mail Usage ##
To begin using this library, you must first include it
-```
+```php
include 'path/to/sendgrid-php/SendGrid_loader.php';
```
Initialize the SendGrid object with your SendGrid credentials
-```
+```php
$sendgrid = new SendGrid('username', 'password');
```
Create a new SendGrid Mail object and add your message details
-```
+```php
$mail = new SendGrid\Mail();
$mail->addTo('foo@bar.com')->
setFrom('me@bar.com')->
@@ -57,11 +58,11 @@ $mail->addTo('foo@bar.com')->
Send it using the API of your choice (SMTP or Web)
-```
+```php
$sendgrid->smtp->send($mail);
```
Or
-```
+```php
$sendgrid->web->send($mail);
```
Please sign in to comment.
Something went wrong with that request. Please try again.