wvdongen / cakephp-sparkpost
SparkPost CakePHP plugin
Installs: 4 771
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 1
Type:cakephp-plugin
Requires
- php: >=5.4.0
- composer/installers: *
- guzzlehttp/guzzle: ~6.2
- php-http/guzzle6-adapter: ~1.1
- psr/log: 1.0.0
- sparkpost/sparkpost: ~2.0
This package is not auto-updated.
Last update: 2025-02-21 22:06:04 UTC
README
Installation
You can clone the plugin into your project:
cd path/to/app/Plugin
git clone https://github.com/wvdongen/cakephp-sparkpost.git SparkPost
Also you can use composer for install this plugin. Just add new requirement to your composer.json
"require": {
...,
"wvdongen/cakephp-sparkpost": "*"
},
Bootstrap the plugin in app/Config/bootstrap.php:
CakePlugin::load('SparkPost');
Configuration
Create the file app/Config/email.php with the class EmailConfig.
<?php class EmailConfig { public $sparkPost = array( 'transport' => 'SparkPost.SparkPost', 'emailFormat' => 'both', 'sparkpost' => array( 'api_key' => 'YOUR_API_KEY', 'timeout' => '120', // optional, set non-default timeout 'options' => [ // See https://developers.sparkpost.com/api/transmissions.html 'transactional' => false, ], 'log' => array( // optional, write to CakeLog 'level' => 'debug', // optional, see Psr\Log\LogLevel, but cannot use class constants here. 'format' => '{response}', // optional, string with token substitution, see https://github.com/guzzle/guzzle/blob/master/src/MessageFormatter.php#L12'. ), ), ); }
Requirements
CakePHP 2.0+