Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…prerelease
  • Loading branch information...
commit 27e7df3a12a34558de70c62fec4130a0e6d6c087 2 parents 4edeb89 + d294367
CJ Buchmann authored
Showing with 60 additions and 0 deletions.
  1. +60 −0 README.md
60 README.md
View
@@ -64,3 +64,63 @@ Or
```php
$sendgrid->web->send($mail);
```
+
+### Using Categories ###
+
+Categories are used to group email statistics provided by SendGrid
+
+To use a category, simply set the category name
+
+```php
+$mail = new SendGrid\Mail();
+$mail->addTo('foo@bar.com')->
+ ...
+ addCategory("Category 1")->
+ addCategory("Category 2");
+```
+
+
+### Using Attachments ###
+
+Attachments are currently file based only, with future plans for an in memory implementation as well.
+
+File attachments are limited to 7 MB per file.
+
+```php
+$mail = new SendGrid\Mail();
+$mail->addTo('foo@bar.com')->
+ ...
+ addAttachment("../path/to/file.txt");
+```
+
+### Using Substitutions ###
+
+Substitutions can be used to customize multi-recipient emails, and tailor them for the user
+
+```php
+$mail = new SendGrid\Mail();
+$mail->addTo('john@somewhere.com')->
+ addTo("harry@somewhere.com")->
+ addTo("Bob@somewhere.com")->
+ ...
+ setHtml("Hey %name%, we've seen that you've been gone for a while")->
+ addSubstitution("%name%", array("John", "Harry", "Bob"));
+```
+
+### Using Sections ###
+
+Sections can be used to further customize messages for the end users.
+
+```php
+$mail = new SendGrid\Mail();
+$mail->addTo('john@somewhere.com')->
+ addTo("harry@somewhere.com")->
+ addTo("Bob@somewhere.com")->
+ ...
+ setHtml("Hey %name%, you work at %place%")->
+ addSubstitution("%name%", array("John", "Harry", "Bob"))->
+ addSubstitution("%place%", array("%office%", "%office%", "%home%"))->
+ addSection("%office%", array("Mile Square Park", "Platform 4 3/4"))->
+ addSection("%home%", array("The Robinsons"));
+```
+
Please sign in to comment.
Something went wrong with that request. Please try again.