Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from SparkPost/ISSUE-46
Update transmission examples
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
namespace Examples\Transmisson; | ||
require_once (dirname(__FILE__).'/../bootstrap.php'); | ||
|
||
//pull in API key config | ||
$configFile = file_get_contents(dirname(__FILE__) . '/../example-config.json'); | ||
$config = json_decode($configFile, true); | ||
|
||
use SparkPost\SparkPost; | ||
use GuzzleHttp\Client; | ||
use Ivory\HttpAdapter\Guzzle6HttpAdapter; | ||
|
||
$httpAdapter = new Guzzle6HttpAdapter(new Client()); | ||
$sparky = new SparkPost($httpAdapter, ['key'=>$config['api-key']]); | ||
|
||
try { | ||
$results = $sparky->transmission->delete('transmission-id'); | ||
echo 'Transmission deleted!'; | ||
} catch (\Exception $exception) { | ||
echo $exception->getMessage(); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters