quartzy / courier-sparkpost
An adapter to use SparkPost with Courier
Installs: 13 246
Dependents: 0
Suggesters: 1
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.1
- psr/log: ^1.0
- quartzy/courier: ^0.6.0
- sparkpost/sparkpost: ^2.1
Requires (Dev)
- ext-imap: *
- guzzlehttp/guzzle: ^6.3
- mockery/mockery: ^0.9.8
- php-http/guzzle6-adapter: ^1.1
- phpunit/phpunit: ^7.0
- vlucas/phpdotenv: ^2.4
- zbateson/mail-mime-parser: ^0.4.8
README
A courier implementation for SparkPost.
See documentation for full details.
Install
Via Composer
composer require quartzy/courier-sparkpost
You will also need to install a php-http implementation library as defined in the SparkPost docs.
Usage
<?php use Courier\SparkPost\SparkPostCourier; use GuzzleHttp\Client; use Http\Adapter\Guzzle6\Client as GuzzleAdapter; use PhpEmail\Content\TemplatedContent; use PhpEmail\EmailBuilder; use SparkPost\SparkPost; new Client(); $courier = new SparkPostCourier( new SparkPost(new GuzzleAdapter(new Client()), ['key'=>'YOUR_API_KEY']) ); $email = EmailBuilder::email() ->from('test@mybiz.com') ->to('loyal.customer@email.com') ->replyTo('test@mybiz.com', 'Your Sales Rep') ->withSubject('Welcome!') ->withContent(new TemplatedContent('my_email', ['testKey' => 'value'])) ->build(); $courier->deliver($email);
For details on building the email objects, see Php Email.
Change log
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email opensource@quartzy.com instead of using the issue tracker.
Credits
License
The Apache License, v2.0. Please see License File for more information.