You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-5Lines changed: 13 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
[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.
@@ -14,22 +14,28 @@ Before using this library, you must have a valid API Key.
14
14
To get an API Key, please log in to your SparkPost account and generate one in the Settings page.
15
15
16
16
## Installation
17
-
The recommended way to install the SparkPost PHP SDK is through composer.
17
+
The recommended way to install the SparkPost PHP Library is through composer.
18
+
18
19
```
19
20
# Install Composer
20
21
curl -sS https://getcomposer.org/installer | php
21
22
```
22
-
Next, run the Composer command to install the SparkPost PHP SDK:
23
+
24
+
Next, run the Composer command to install the SparkPost PHP Library:
25
+
23
26
```
24
27
composer require sparkpost/php-sparkpost
25
28
```
29
+
26
30
After installing, you need to require Composer's autoloader:
31
+
27
32
```php
28
33
require 'vendor/autoload.php';
29
34
use SparkPost\SparkPost;
30
35
```
31
36
32
37
## Setting up a Request Adapter
38
+
33
39
Because of dependency collision, we have opted to use a request adapter rather than
34
40
requiring a request library. This means that your application will need to pass in
35
41
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
38
44
GuzzleHttp Client Library.
39
45
40
46
An Adapter can be setup like so:
47
+
41
48
```php
42
49
use SparkPost\SparkPost;
43
50
use GuzzleHttp\Client;
@@ -48,6 +55,7 @@ $sparky = new SparkPost($httpAdapter, ['key'=>'YOUR API KEY']);
48
55
```
49
56
50
57
## Getting Started: Your First Mailing
58
+
51
59
```php
52
60
require 'vendor/autoload.php';
53
61
@@ -114,10 +122,10 @@ try {
114
122
## Tips and Tricks
115
123
### General
116
124
* You _must_ provide at least an API key when instantiating the SparkPost Library - `[ 'key'=>'184ac5480cfdd2bb2859e4476d2e5b1d2bad079bf' ]`
117
-
* The SDK's features are namespaced under the various SparkPost API names.
125
+
* The Libraries features are namespaced under the various SparkPost API names.
118
126
119
127
### Transmissions
120
-
* If you specify a stored recipient list and inline recipients in a Transmission, you will recieve an error.
128
+
* If you specify a stored recipient list and inline recipients in a Transmission, you will receive an error.
121
129
* If you specify HTML and/or Plain Text content and then provide RFC-822 encoded content, you will receive an error.
122
130
* RFC-822 content is not valid with any other content type.
123
131
* If you specify a stored template and also provide inline content via `html` or `text`, you will receive an error.
0 commit comments