Skip to content

Commit 2ca3b87

Browse files
committed
Merge branch 'feature/MA-1084' into develop
2 parents 39f2699 + 3095de0 commit 2ca3b87

18 files changed

+695
-740
lines changed

README.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ curl -sS https://getcomposer.org/installer | php
1313
```
1414
Next, run the Composer command to install the SparkPost PHP SDK:
1515
```
16-
composer require messagesystems/php-sdk
16+
composer require sparkpost/php-sparkpost
1717
```
1818
After installing, you need to require Composer's autoloader:
1919
```
@@ -26,14 +26,14 @@ SparkPost::setConfig(["key"=>"YOUR API KEY"]);
2626
2727
try {
2828
// Build your email and send it!
29-
Transmission::send(['campaign'=>'first-mailing',
29+
Transmission::send(array('campaign'=>'first-mailing',
3030
'from'=>'you@your-company.com',
3131
'subject'=>'First SDK Mailing',
3232
'html'=>'<html><body><h1>Congratulations, {{name}}!</h1><p>You just sent your very first mailing!</p></body></html>',
3333
'text'=>'Congratulations, {{name}}!! You just sent your very first mailing!',
34-
'substitutionData'=>['name'=>'YOUR FIRST NAME'],
35-
'recipients'=>[['address'=>['name'=>'YOUR FULL NAME', 'email'=>'YOUR EMAIL ADDRESS' ]]]
36-
]);
34+
'substitutionData'=>array('name'=>'YOUR FIRST NAME'),
35+
'recipients'=>array(array('address'=>array('name'=>'YOUR FULL NAME', 'email'=>'YOUR EMAIL ADDRESS' )))
36+
));
3737
3838
echo 'Woohoo! You just sent your first mailing!';
3939
} catch (Exception $err) {
@@ -44,9 +44,33 @@ try {
4444

4545
## Learn More
4646
* For more detailed examples, check our examples:
47-
* [Transmissions](https://github.com/MessageSystems/php-sdk/tree/master/examples/transmission/)
47+
* [Transmissions](https://github.com/SparkPost/php-sparkpost/tree/master/examples/transmission)
4848
* Read our REST API documentation - <http://www.sparkpost.com/docs/introduction>
4949

50+
## Field Descriptions
51+
### Transmissions
52+
| Field Name | Required? | Description | Data Type |
53+
| ------------ | ----------- | ------------- | ----------- |
54+
| description | no | Field for describing what this transmission is for the user | String |
55+
| campaign | no | Field for assigning a given transmission to a specific campaign, which is a logical container for similar transmissions | String |
56+
| metadata | no | Field for adding arbitrary key/value pairs which will be included in open/click tracking | Object (Simple) |
57+
| substitutionData | no | Field for adding transmission level substitution data, which can be used in a variety of fields and in content | Object (Complex) |
58+
| trackOpens | no | Field for enabling/disabling transmission level open tracking (default: true) | Boolean |
59+
| trackClicks | no | Field for enabling/disabling transmission level click tracking (default: true) | Boolean |
60+
| useDraftTemplate | no | Field for allowing the sending of a transmission using a draft of a stored template (default: false) | Boolean |
61+
| replyTo | no | Field for specifying the email address that should be used when a recipient hits the reply button | String |
62+
| subject | yes | Field for setting the subject line of a given transmission | String |
63+
| from | yes | Field for setting the from line of a given transmission | String or Object |
64+
| html | yes** | Field for setting the HTML content of a given transmission | String |
65+
| text | yes** | Field for setting the Plain Text content of a given transmission | String |
66+
| rfc822 | no** | Field for setting the RFC-822 encoded content of a given transmission | String |
67+
| template | no** | Field for specifying the Template ID of a stored template to be used when sending a given transmission | String |
68+
| customHeaders | no | Field for specifying additional headers to be applied to a given transmission (other than Subject, From, To, and Reply-To) | Object (Simple) |
69+
| recipients | yes** | Field for specifying who a given transmission should be sent to | Array of Objects |
70+
| recipientList | no** | Field for specifying a stored recipient list ID to be used for a given transmission | String |
71+
72+
** - If using inline content then html or text are required. If using RFC-822 Inline Content, then rfc822 is required. If using a stored recipient list, then recipientList is required. If using a stored template, then template is required.
73+
5074
## Tips and Tricks
5175
### General
5276
* You _must_ provide at least an API key when instantiating the SparkPost Library - `[ 'key'=>'184ac5480cfdd2bb2859e4476d2e5b1d2bad079bf' ]`
@@ -63,12 +87,12 @@ try {
6387
## Development
6488

6589
### Setup
66-
We use [Robo](http://robo.li/) for our task runner.
67-
68-
Run `composer install` inside the directory to install dependecies and development tools including Robo.
90+
Run `composer install` inside the directory to install dependecies and development tools.
6991

7092
### Testing
71-
Once all the dependencies are installed, you can execute the unit tests using `vendor\bin\robo test`
93+
Once all the dependencies are installed, you can execute the unit tests using `vendor/bin/phpunit --bootstrap test/unit/bootstrap.php ./test/unit`.
94+
95+
If you're interested in code coverage, you can add the `--coverage` flag for phpunit like so: ```phpunit --coverage-html test/output/report --bootstrap test/unit/bootstrap.php ./test/unit```
7296

7397
### Contributing
7498
Guidelines for adding issues

RoboFile.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

composer.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
{
2-
"name": "messagesystems/php-sdk",
3-
"description": "SDK for interfacing with messagesystems APIs",
4-
"license": "Apache",
2+
"name": "sparkpost/php-sparkpost",
3+
"description": "SDK for interfacing with SparkPost APIs",
4+
"license": "Apache 2.0",
55
"authors": [
66
{
7-
"name": "Message Systems",
8-
"email": "info@messagesystems.com"
7+
"name": "Message Systems, Inc."
98
}
109
],
1110
"minimum-stability": "stable",
1211
"require": {
13-
"php": ">=5.6.1",
14-
"guzzlehttp/guzzle": "5.0.1"
12+
"php": ">=5.3.0",
13+
"guzzlehttp/guzzle": "3.8.1"
1514
},
1615
"require-dev": {
17-
"phpunit/phpunit": "4.3.*",
18-
"codegyre/robo": "0.4.6"
16+
"phpunit/phpunit": "4.3.*"
1917
},
2018
"autoload": {
2119
"psr-4": {
22-
"MessageSystems\\": "lib/MessageSystems/"
20+
"SparkPost\\": "lib/SparkPost/",
21+
"SparkPost\\SendGridCompatibility\\": "lib/SendGridCompatibility/"
2322
}
2423
}
2524
}

0 commit comments

Comments
 (0)