Skip to content

Commit 7b12923

Browse files
committed
Merge pull request #23 from SparkPost/example-config
Example config
2 parents 59819ca + 9532e9b commit 7b12923

12 files changed

+246
-157
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
.settings
44
.buildpath
55
test/output/
6+
examples/example-config.json

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The recommended way to install the SparkPost PHP SDK is through composer.
1313
# Install Composer
1414
curl -sS https://getcomposer.org/installer | php
1515
```
16-
Next, run the Composer command to install the SparkPost PHP SDK:
16+
Next, run the Composer command to install the SparkPost PHP SDK:
1717
```
1818
composer require sparkpost/php-sparkpost
1919
```
@@ -29,7 +29,7 @@ SparkPost::setConfig(["key"=>"YOUR API KEY"]);
2929
3030
try {
3131
// Build your email and send it!
32-
Transmission::send(array('campaign'=>'first-mailing',
32+
Transmission::send(array('campaign'=>'first-mailing',
3333
'from'=>'you@your-company.com',
3434
'subject'=>'First SDK Mailing',
3535
'html'=>'<html><body><h1>Congratulations, {{name}}!</h1><p>You just sent your very first mailing!</p></body></html>',
@@ -93,13 +93,13 @@ try {
9393
Run `composer install` inside the directory to install dependecies and development tools.
9494

9595
### Testing
96-
Once all the dependencies are installed, you can execute the unit tests using `vendor/bin/phpunit --bootstrap test/unit/bootstrap.php ./test/unit`.
97-
98-
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```
96+
Once all the dependencies are installed, you can execute the unit tests using:
97+
```
98+
composer test
99+
```
99100

100101
### Contributing
101102
1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
102103
2. Fork [the repository](http://github.com/SparkPost/php-sparkpost) on GitHub to start making your changes to the **master** branch (or branch off of it).
103104
3. Write a test which shows that the bug was fixed or that the feature works as expected.
104105
4. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to [AUTHORS](https://github.com/SparkPost/php-sparkpost/blob/master/AUTHORS.md).
105-

composer.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
"description": "SDK for interfacing with SparkPost APIs",
44
"license": "Apache 2.0",
55
"authors": [
6-
{
7-
"name": "Message Systems, Inc."
8-
}
6+
{
7+
"name": "Message Systems, Inc."
8+
}
99
],
1010
"minimum-stability": "stable",
11+
"scripts": {
12+
"post-install-cmd": "if [ ! -f 'examples/example-config.json' ]; then echo '{\n\t\"api-key\":\"Your API Key\"\n}' >> examples/example-config.json; fi",
13+
"post-update-cmd": "if [ ! -f 'examples/example-config.json' ]; then echo '{\n\t\"api-key\":\"Your API Key\"\n}' >> examples/example-config.json; fi",
14+
"test": "phpunit --coverage-html test/output/report --bootstrap test/unit/bootstrap.php ./test/unit/"
15+
},
1116
"require": {
1217
"php": ">=5.3.0",
1318
"guzzlehttp/guzzle": "3.8.1"

0 commit comments

Comments
 (0)