PHPackages                             dallasmakerspace/cakephp-sparkpost-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. dallasmakerspace/cakephp-sparkpost-plugin

ActiveCakephp-plugin[Mail &amp; Notifications](/categories/mail)

dallasmakerspace/cakephp-sparkpost-plugin
=========================================

A CakePHP plugin for sending mail via SparkPost's REST API

v1.0.6(7y ago)0375MITPHP

Since Apr 6Pushed 7y ago8 watchersCompare

[ Source](https://github.com/Dallas-Makerspace/cakephp-sparkpost-plugin)[ Packagist](https://packagist.org/packages/dallasmakerspace/cakephp-sparkpost-plugin)[ Docs](https://github.com/syntaxera/cakephp-sparkpost-plugin)[ RSS](/packages/dallasmakerspace-cakephp-sparkpost-plugin/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (6)Versions (24)Used By (0)

CakePHP SparkPost Plugin
========================

[](#cakephp-sparkpost-plugin)

A CakePHP plugin for sending mail via SparkPost's REST API

[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/ac05434c2df7684da57156fc7613d606ecc3548e2d95765ca2c74a2d5d01585f/68747470733a2f2f6170692e7472617669732d63692e6f72672f73796e7461786572612f63616b657068702d737061726b706f73742d706c7567696e2e706e67)](https://travis-ci.org/syntaxera/cakephp-sparkpost-plugin)[![Coverage Status](https://camo.githubusercontent.com/d1da5818dae26fe81d7f028281f992fd325970b5a24f25d18a1e043b884e2b4c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f73796e7461786572612f63616b657068702d737061726b706f73742d706c7567696e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/syntaxera/cakephp-sparkpost-plugin)[![Total Downloads](https://camo.githubusercontent.com/6d2cce4504f843ca70bf6cb373108b85610d1991f80015b62afeaf13ed4f3fa9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73796e7461786572612f63616b657068702d737061726b706f73742d706c7567696e2e737667)](https://packagist.org/packages/syntaxera/cakephp-sparkpost-plugin)[![Latest Stable Version](https://camo.githubusercontent.com/6c9662969212e4dae8dfb6071fde2595d585e543bf33612f3a214f92d6bbf37e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73796e7461786572612f63616b657068702d737061726b706f73742d706c7567696e2e7376673f6c6162656c3d737461626c65)](https://packagist.org/packages/syntaxera/cakephp-sparkpost-plugin)[![Latest Unstable Version](https://camo.githubusercontent.com/c4ece2e7a8c6e4ffef1f372e455b7839c9243c7d35285a1f319907550389e7a5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f73796e7461786572612f63616b657068702d737061726b706f73742d706c7567696e2e7376673f6c6162656c3d756e737461626c65)](https://packagist.org/packages/syntaxera/cakephp-sparkpost-plugin)

Introduction
============

[](#introduction)

What is SparkPost?
------------------

[](#what-is-sparkpost)

[SparkPost](https://www.sparkpost.com) is a web-based email delivery service that allows web application developers to send transactional email via a flexible and reliable REST API. You may have heard of other email delivery services such as [Mandrill](https://mandrillapp.com) and [SendGrid](https://sendgrid.com).

Unfortunately these services are either not free or were once free but are no longer. Luckily, sending emails via SparkPost is free if you send less than 15,000 emails per month (which most fledgling webapps do).

Syntax Era developed this plugin because we use CakePHP in most of our apps,and because we noticed that there weren't any CakePHP plugins for SparkPost. We hope that this plugin proves to be useful to the CakePHP community at large but especially those migrating from Mandrill or another paid email service who still aren't ready/able to pay for the tiny amount of transactional emails they send.

#### Transactional email...?

[](#transactional-email)

Transactional email is email that is sent to notify users of something, or sometimes to prompt users to complete an action. For example, password reset emails, account verification emails, and "you just got a message" emails are all transactional.

For more information, see [What is transactional email?](https://blog.mailchimp.com/what-is-transactional-email).

What is CakePHP?
----------------

[](#what-is-cakephp)

CakePHP is a rapid-development PHP web application framework that uses the MVC (Models/Views/Controllers) architecture. It was first released in August 2005 and is now on version 3.0 and is more powerful than ever! One of CakePHP's great features is that it supports extending its own functionality via the use of plugins, of which this is one.

For more information about CakePHP, visit their website at [CakePHP.org](http://cakephp.org).

Installation
============

[](#installation)

Command-Line Installation
-------------------------

[](#command-line-installation)

Using Composer is the recommended way of installing this plugin because it allows you to easily download the plugin and its dependencies and keep them up-to-date and make use of Composer's awesome class auto-loader.

To install the plugin using Composer:

1. Open a terminal and `cd` to your CakePHP application's root directory.
2. Run `composer require syntaxera/cakephp-sparkpost-plugin` to download the plugin and its dependencies.
3. If you'd like, open `composer.json` for editing and modify the versioning schema for the plugin to your liking.

Manual Installation
-------------------

[](#manual-installation)

You can also install the plugin manually by clicking the "Download ZIP" button above and unzipping it into your CakePHP application's `plugins/` directory, **however if you do this you will have to perform updates manually as well.**

If you're familiar with git you can also download the repository directly to your hard drive using `git clone`. This allows you to stay on the bleeding-edge of the plugin's development, but be warned that it's called "bleeding-edge" for a reason.

Setup
=====

[](#setup)

To add the plugin to your application, activate the plugin in your application's bootstrap file:

```
Plugin::load('SparkPost');
```

Then add the following to your application's config file:

```
'SparkPost' => [
    'Api' => [
        'key' => 'YOUR_SPARKPOST_API_KEY'
    ]
]
```

Usage
=====

[](#usage)

Because the plugin is implemented as a Transport, you can use it from just about any layer of your CakePHP application.

From a Controller
-----------------

[](#from-a-controller)

```
// Configure email transport
Email::configTransport('sparkpost', [
    'className' => 'SparkPost.SparkPost',
    'apiKey' => Configure::read('SparkPost.Api.key')
]);

// Create email message
$email = new Email();
$email->transport('sparkpost');

$email->from(['FROM_ADDRESS' => 'FROM_NAME']);
$email->to(['TO_ADDRESS' => 'TO_NAME']);
$email->subject('SUBJECT');
$email->send('BODY');
```

From the Cake CLI
-----------------

[](#from-the-cake-cli)

Exactly the same process as sending from a controller, however you should additionally specify your hostname with `$email->domain('www.example.com');` because CLI environments do not have hostnames.

Testing
=======

[](#testing)

You can test the plugin using CakePHP's built-in support for PHPUnit, however this assumes two things:

1. You have PHPUnit globally installed and the `phpunit` command available from the command-line
2. You didn't delete the `phpunit.xml.dist` that is created with new CakePHP 3.x applications

To test the plugin, first add its test suites to the application's PHPUnit config file:

```

    ...

            ./tests/TestCase

            ./vendor/syntaxera/cakephp-sparkpost-plugin/tests/TestCase

    ...

```

Next, `cd` to your application's root directory and run `phpunit`.

If that doesn't work, run `composer dump-autoload` and try again.

Contributing
============

[](#contributing)

Bug Reports
-----------

[](#bug-reports)

If you find a bug in the plugin, or know of a missing feature you'd like to see added, feel free to create an issue on the [Issues page](https://github.com/syntaxera/cakephp-sparkpost-plugin/issues). **When reporting a bug, be as descriptive as possible. Include what you were doing when the bug occurred, what might have caused it to occur, and how to reproduce it if possible. Screenshots are nice, too.**

As a matter of courtesy, please use the search tool to verify that an issue has not already been reported before creating a new issue. Feel free to add your comments/+1's to an open bug/feature request, but duplicate issues take time to prune and crowd out new, important issues.

Pull Requests
-------------

[](#pull-requests)

Found a bug you think you can fix? By all means go ahead! Clone the affected branch, fix the bug, then create a pull request and we'll review and accept it as quickly as we can. However, before submitting a pull request, please be sure that your code follows our [Code Style Guidelines](http://syntaxera.io/pages/codestyle). PRs that don't follow the style guidelines will be rejected! (politely, of course)

#### A Word on Forks...

[](#a-word-on-forks)

At Syntax Era we believe that certain software should be free, and this plugin is definitely in that category. That's why we've made this repository public, and why we allow contributions from the community. If you want to take this project in a different direction, thenust fork the repo and develop away! **Because we have no control over the source code in a fork, however, we cannot provide support for that software.** Use it at your own risk.

Legal
=====

[](#legal)

License
-------

[](#license)

Licensed under the MIT License (MIT). See `LICENSE.md` for details.

Copyright
---------

[](#copyright)

Copyright (c) 2016 Syntax Era Development Studio. All rights reserved.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~47 days

Recently: every ~0 days

Total

22

Last Release

2700d ago

Major Versions

v0.4.5 → v1.0.02018-12-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/24595b29d12508f0765531e1f717ca59901b1070fedbfd649a258298efd39ea5?d=identicon)[MikeColeGuru](/maintainers/MikeColeGuru)

---

Top Contributors

[![MikeColeGuru](https://avatars.githubusercontent.com/u/19918682?v=4)](https://github.com/MikeColeGuru "MikeColeGuru (6 commits)")[![mary-grace](https://avatars.githubusercontent.com/u/8039851?v=4)](https://github.com/mary-grace "mary-grace (1 commits)")

---

Tags

pluginemailcakephpmandrillsparkpost

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dallasmakerspace-cakephp-sparkpost-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/dallasmakerspace-cakephp-sparkpost-plugin/health.svg)](https://phpackages.com/packages/dallasmakerspace-cakephp-sparkpost-plugin)
```

###  Alternatives

[lorenzo/cakephp-email-queue

Queue, preview and and send emails stored in the database

57121.5k1](/packages/lorenzo-cakephp-email-queue)[narendravaghela/cakephp-mailgun

Mailgun plugin for CakePHP - Send emails using Mailgun API

23356.6k](/packages/narendravaghela-cakephp-mailgun)[gourmet/email

Gourmet Email Plugin for rapid CakePHP application development.

175.2k](/packages/gourmet-email)[djagya/yii2-sparkpost

A library provides Yii2 integration with SparkPost mail service

1816.3k](/packages/djagya-yii2-sparkpost)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
