diff options
Diffstat (limited to 'examples/transmission/rfc822.php')
-rw-r--r-- | examples/transmission/rfc822.php | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/examples/transmission/rfc822.php b/examples/transmission/rfc822.php index b97bbb9..ec932e7 100644 --- a/examples/transmission/rfc822.php +++ b/examples/transmission/rfc822.php @@ -3,23 +3,26 @@ namespace Examples\Transmisson; require_once (dirname(__FILE__).'/../bootstrap.php'); use SparkPost\SparkPost; use SparkPost\Transmission; +use GuzzleHttp\Client; +use Ivory\HttpAdapter\Guzzle6HttpAdapter; -$key = 'YOURAPIKEY'; -SparkPost::setConfig(array('key'=>$key)); +$key = 'YOUR API KEY'; +$httpAdapter = new Guzzle6HttpAdapter(new Client()); +SparkPost::configure($httpAdapter, ['key'=>$key]); try { - $results = Transmission::send(array( - 'recipients'=>array( - array( - 'address'=>array( - 'email'=>'john.doe@sample.com' - ) - ) - ), - 'rfc822'=>"Content-Type: text/plain\nFrom: From Envelope <from@example.com>\nSubject: Example Email\n\nHello World" - )); + $results = Transmission::send([ + 'recipients'=>[ + [ + 'address'=>[ + 'email'=>'john.doe@example.com' + ] + ] + ], + 'rfc822'=>"Content-Type: text/plain\nFrom: From Envelope <from@sparkpostbox.com>\nSubject: Example Email\n\nHello World" + ]); echo 'Congrats you can use your SDK!'; } catch (\Exception $exception) { echo $exception->getMessage(); } -?>
\ No newline at end of file +?> |