diff options
author | Jordan Nornhold <nornholdj@gmail.com> | 2015-11-20 17:12:05 -0500 |
---|---|---|
committer | Jordan Nornhold <nornholdj@gmail.com> | 2015-11-20 17:12:05 -0500 |
commit | 079c21446283a4adc3a4ac6f7c0c9ad7f86d34b7 (patch) | |
tree | 536a83f26f2eab7302b2d3e6ba11a7b4be9a1924 | |
parent | 25ad59926b5ea6df172e269fc98e54fde76f76ab (diff) | |
parent | 971c0115560c7b5223d82f37f4a0cf8a35af1e03 (diff) | |
download | php-sparkpost-079c21446283a4adc3a4ac6f7c0c9ad7f86d34b7.zip php-sparkpost-079c21446283a4adc3a4ac6f7c0c9ad7f86d34b7.tar.gz php-sparkpost-079c21446283a4adc3a4ac6f7c0c9ad7f86d34b7.tar.bz2 |
Merge pull request #35 from yepher/master
Changes wording SDK to Library and adds some spacing so the file rend…
-rw-r--r-- | README.md | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -2,7 +2,7 @@ [Sign up](https://app.sparkpost.com/sign-up?src=Dev-Website&sfdcid=70160000000pqBb) for a SparkPost account and visit our [Developer Hub](https://developers.sparkpost.com) for even more content. -# SparkPost PHP SDK +# SparkPost PHP Library [](https://travis-ci.org/SparkPost/php-sparkpost) [](https://coveralls.io/github/SparkPost/php-sparkpost?branch=master) @@ -14,22 +14,28 @@ Before using this library, you must have a valid API Key. To get an API Key, please log in to your SparkPost account and generate one in the Settings page. ## Installation -The recommended way to install the SparkPost PHP SDK is through composer. +The recommended way to install the SparkPost PHP Library is through composer. + ``` # Install Composer curl -sS https://getcomposer.org/installer | php ``` -Next, run the Composer command to install the SparkPost PHP SDK: + +Next, run the Composer command to install the SparkPost PHP Library: + ``` composer require sparkpost/php-sparkpost ``` + After installing, you need to require Composer's autoloader: + ```php require 'vendor/autoload.php'; use SparkPost\SparkPost; ``` ## Setting up a Request Adapter + Because of dependency collision, we have opted to use a request adapter rather than requiring a request library. This means that your application will need to pass in a request adapter to the constructor of the SparkPost Library. We use the [Ivory HTTP Adapter] (https://github.com/egeloen/ivory-http-adapter) in SparkPost. Please visit their repo @@ -38,6 +44,7 @@ need to require one and create an adapter from it and pass it along. The exampl GuzzleHttp Client Library. An Adapter can be setup like so: + ```php use SparkPost\SparkPost; use GuzzleHttp\Client; @@ -48,6 +55,7 @@ $sparky = new SparkPost($httpAdapter, ['key'=>'YOUR API KEY']); ``` ## Getting Started: Your First Mailing + ```php require 'vendor/autoload.php'; @@ -114,10 +122,10 @@ try { ## Tips and Tricks ### General * You _must_ provide at least an API key when instantiating the SparkPost Library - `[ 'key'=>'184ac5480cfdd2bb2859e4476d2e5b1d2bad079bf' ]` -* The SDK's features are namespaced under the various SparkPost API names. +* The library's features are namespaced under the various SparkPost API names. ### Transmissions -* If you specify a stored recipient list and inline recipients in a Transmission, you will recieve an error. +* If you specify a stored recipient list and inline recipients in a Transmission, you will receive an error. * If you specify HTML and/or Plain Text content and then provide RFC-822 encoded content, you will receive an error. * RFC-822 content is not valid with any other content type. * If you specify a stored template and also provide inline content via `html` or `text`, you will receive an error. |