Download the PHP package priyolahiri/sendgrid-php without Composer
On this page you can find all versions of the php package priyolahiri/sendgrid-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download priyolahiri/sendgrid-php
More information about priyolahiri/sendgrid-php
Files in priyolahiri/sendgrid-php
Package sendgrid-php
Short Description This library allows you to quickly and easily send emails through SendGrid using PHP.
License MIT
Homepage http://sendgrid.com
Informations about the package sendgrid-php
sendgrid-php
This library allows you to quickly and easily send emails through SendGrid using PHP.
License
Licensed under the MIT License.
Downloading
Installing the SendGrid package is as simple as adding it to your project's include path and requiring it. If you're using git, you can just clone down the repo like this:
Note: If you don't have git or would rather install by unpacking a Zip or Tarball, you can always grab the latest version of the package from the downloads page.
Testing
The existing tests in the Test
directory can be run using PHPUnit with the following command:
SendGrid APIs
SendGrid provides two methods of sending email: the Web API, and SMTP API. SendGrid recommends using the SMTP API for sending emails. For an explanation of the benefits of each, refer to http://docs.sendgrid.com/documentation/get-started/integrate/examples/smtp-vs-rest/.
This library implements a common interface to make it very easy to use either API.
Mail Pre-Usage
Before we begin using the library, its important to understand a few things about the library architecture...
-
The SendGrid Mail object is the means of setting mail data. In general, data can be set in three ways for most elements:
- set - reset the data, and initialize it to the given element. This will destroy previous data
- set (List) - for array based elements, we provide a way of passing the entire array in at once. This will also destroy previous data.
- add - append data to the list of elements.
- Sending an email is as simple as :
- Creating a SendGrid Instance
- Creating a SendGrid Mail object, and setting its data
- Sending the mail using either SMTP API or Web API.
Mail Usage
To begin using this library, you must first include it
Then, initialize the SendGrid object with your SendGrid credentials
Create a new SendGrid Mail object and add your message details
Send it using the API of your choice (SMTP or Web)
Or
Using Categories
Categories are used to group email statistics provided by SendGrid.
To use a category, simply set the category name. Note: there is a maximum of 10 categories per email.
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.
Using Substitutions
Substitutions can be used to customize multi-recipient emails, and tailor them for the user
Using Sections
Sections can be used to further customize messages for the end users. A section is only useful in conjunction with a substition value.
Using Unique Arguments
Unique Arguments are used for tracking purposes
Using Filter Settings
Filter Settings are used to enable and disable apps, and to pass parameters to those apps.
Using Headers
Headers can be used to add existing sendgrid functionality (such as for categories or filters), or custom headers can be added as necessary.