PHPackages                             maurymmarques/postmark-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. maurymmarques/postmark-plugin

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

maurymmarques/postmark-plugin
=============================

A CakePHP plugin that makes email delivery using Postmark

2011.7k11PHP

Since Feb 15Pushed 8y ago2 watchersCompare

[ Source](https://github.com/maurymmarques/postmark-cakephp)[ Packagist](https://packagist.org/packages/maurymmarques/postmark-plugin)[ RSS](/packages/maurymmarques-postmark-plugin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Postmark plugin for CakePHP
===========================

[](#postmark-plugin-for-cakephp)

CakePHP plugin that makes email delivery using [Postmark](https://postmarkapp.com)

### Version

[](#version)

Written for CakePHP 2.x

### Copyright

[](#copyright)

Copyright (c) 2011 Maury M. Marques

Installation
------------

[](#installation)

You can install this plugin using Composer, GIT Submodule, GIT Clone or Manually

*\[Using [Composer](http://getcomposer.org/)\]*

Add the plugin to your project's `composer.json` - something like this:

```
{
  "require": {
    "maurymmarques/postmark-plugin": "dev-master"
  },
  "extra": {
    "installer-paths": {
      "app/Plugin/Postmark": ["maurymmarques/postmark-plugin"]
    }
  }
}
```

Then just run `composer install`

Because this plugin has the type `cakephp-plugin` set in it's own `composer.json`, composer knows to install it inside your `/Plugin` directory, rather than in the usual vendors file.

*\[GIT Submodule\]*

In your app directory (`app/Plugin`) type:

```
git submodule add git://github.com/maurymmarques/postmark-cakephp.git Plugin/Postmark
git submodule init
git submodule update
```

*\[GIT Clone\]*

In your plugin directory (`app/Plugin` or `plugins`) type:

```
git clone https://github.com/maurymmarques/postmark-cakephp.git Postmark
```

*\[Manual\]*

- Download the [Postmark archive](https://github.com/maurymmarques/postmark-cakephp/archive/master.zip).
- Unzip that download.
- Rename the resulting folder to `Postmark`
- Then copy this folder into `app/Plugin/` or `plugins`

Configuration
-------------

[](#configuration)

Bootstrap the plugin in `app/Config/bootstrap.php`:

```
CakePlugin::load('Postmark');
```

Create the file `app/Config/email.php` with the class EmailConfig.

```
class EmailConfig {
	public $postmark = array(
		'transport' => 'Postmark.Postmark',
		'uri' => 'http://api.postmarkapp.com/email',
		'key' => 'your-postmark-key',
		'track_opens' => true
	);
}
```

If you want your connection to Postmark to be encrypted, simply change the uri to use `https`.

You can set [track\_opens](http://developer.postmarkapp.com/developer-build.html#open-tracking) to `false` or remove it from the config array if you don't want Postmark to track emails. Read more about [Open Tracking](http://blog.postmarkapp.com/post/87919491263/open-tracking-is-finally-here).

Note: Make sure to modified the API key to match the credentials for your Postmark server rack instance.

Proxy
-----

[](#proxy)

You can also configure a proxy in the file `app/Config/email.php`:

```
class EmailConfig {
  public $postmark = array(
    'transport' => 'Postmark.Postmark',
    'uri' => 'http://api.postmarkapp.com/email',
    'key' => 'your-postmark-key',
    'track_opens' => true,
    'proxy' => array(
      'host' => 'your-proxy-host', # Can be an array with settings to authentication class
      'port' => 3128, # Default 3128
      'method' => null, # Proxy method (ie, Basic, Digest). If empty, disable proxy authentication
      'user' => null, # Username if your proxy need authentication
      'pass' => null # Password to proxy authentication
    ),
  );
}
```

Read more about [HttpSocket Parameters](https://api.cakephp.org/2.10/class-HttpSocket.html#_configProxy).

Usage
-----

[](#usage)

This plugin uses [CakeEmail](http://book.cakephp.org/2.0/en/core-utility-libraries/email.html), and works virtually the same.

Then, simply send messages like this:

```
App::uses('CakeEmail', 'Network/Email');
$email = new CakeEmail();

$email->config('postmark');
$email->from('yourpostmark@mail.com');
$email->to('recipient@domain.com');
$email->subject('Test Postmark');
$email->send('Message');
```

Or use more resources:

```
App::uses('CakeEmail', 'Network/Email');
$email = new CakeEmail();

$email->config('postmark');
$email->template('default', 'default');
$email->emailFormat('html');
$email->viewVars(array('name' => 'Your Name'));
$email->from(array('yourpostmark@mail.com' => 'Your Name'));
$email->to(array('recipient1@domain.com' => 'Recipient1', 'recipient2@domain.com' => 'Recipient2'));
$email->cc(array('recipient3@domain.com' => 'Recipient3', 'recipient4@domain.com' => 'Recipient4'));
$email->bcc(array('recipient5@domain.com' => 'Recipient5', 'recipient6@domain.com' => 'Recipient6'));
$email->subject('Test Postmark');
$email->addHeaders(array('Tag' => 'my tag'));
$email->attachments(array(
    'cake.icon.png' => array(
        'file' => WWW_ROOT . 'img' . DS . 'cake.icon.png'
	)
));

$email->send();
```

If you need the instance of the class PostmarkTrasport:

```
App::uses('CakeEmail', 'Network/Email');
$email = new CakeEmail();

$postmarkInstance = $email->transport('Postmark.Postmark')->transportClass();
```

The syntax of all parameters is the same as the default CakeEmail:

For more information, see the Postmark API documentation:

Debugging
---------

[](#debugging)

You can see the response from Postmark in the return value when you send a message:

```
$result = $email->send('Message');
$this->log($result, 'debug');
```

If there are any errors, they'll be included in the response. See the Postmark API documentation for error code detail:

CakePHP 1.3+
------------

[](#cakephp-13)

This class does not work for CakePHP 1.3, for this see:

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.4% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/338086?v=4)[Maury Marques](/maintainers/maurymmarques)[@maurymmarques](https://github.com/maurymmarques)

---

Top Contributors

[![maurymmarques](https://avatars.githubusercontent.com/u/338086?v=4)](https://github.com/maurymmarques "maurymmarques (50 commits)")[![jmillerdesign](https://avatars.githubusercontent.com/u/848523?v=4)](https://github.com/jmillerdesign "jmillerdesign (4 commits)")[![jboesch](https://avatars.githubusercontent.com/u/46987?v=4)](https://github.com/jboesch "jboesch (2 commits)")[![domstubbs](https://avatars.githubusercontent.com/u/717265?v=4)](https://github.com/domstubbs "domstubbs (1 commits)")[![HaroldPutman](https://avatars.githubusercontent.com/u/4070255?v=4)](https://github.com/HaroldPutman "HaroldPutman (1 commits)")[![manobi](https://avatars.githubusercontent.com/u/82986?v=4)](https://github.com/manobi "manobi (1 commits)")[![atomtigerzoo](https://avatars.githubusercontent.com/u/240155?v=4)](https://github.com/atomtigerzoo "atomtigerzoo (1 commits)")[![twkm](https://avatars.githubusercontent.com/u/11297809?v=4)](https://github.com/twkm "twkm (1 commits)")[![daniouyea](https://avatars.githubusercontent.com/u/1612938?v=4)](https://github.com/daniouyea "daniouyea (1 commits)")[![DavidOliver](https://avatars.githubusercontent.com/u/192853?v=4)](https://github.com/DavidOliver "DavidOliver (1 commits)")

### Embed Badge

![Health badge](/badges/maurymmarques-postmark-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/maurymmarques-postmark-plugin/health.svg)](https://phpackages.com/packages/maurymmarques-postmark-plugin)
```

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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