2017 © Pedro Peláez
 

cakephp-plugin cakephp-sparkpost

SparkPost CakePHP plugin

image

wvdongen/cakephp-sparkpost

SparkPost CakePHP plugin

  • Friday, January 19, 2018
  • by wvdongen
  • Repository
  • 1 Watchers
  • 1 Stars
  • 2,307 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 1 Versions
  • 10 % Grown

The README.md

cakephp-sparkpost

Installation

You can clone the plugin into your project:, (*1)

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, (*2)

"require": {
    ...,
    "wvdongen/cakephp-sparkpost": "*"
},

Bootstrap the plugin in app/Config/bootstrap.php:, (*3)

CakePlugin::load('SparkPost');

Configuration

Create the file app/Config/email.php with the class EmailConfig., (*4)

<?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+, (*5)

The Versions