PHPackages                             sweelix/yii2-postmark - 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. sweelix/yii2-postmark

Abandoned → [blackcube/yii2-mailer](/?search=blackcube%2Fyii2-mailer)Yii2-extension[Mail &amp; Notifications](/categories/mail)

sweelix/yii2-postmark
=====================

PHP 5.6+ PostmarkApp integration for the Yii framework

1.2.0(8y ago)4124.8k↓66.7%4BSD-3-ClausePHPPHP &gt;=5.6.0

Since Apr 21Pushed 8y ago2 watchersCompare

[ Source](https://github.com/pgaultier/yii2-postmark)[ Packagist](https://packagist.org/packages/sweelix/yii2-postmark)[ RSS](/packages/sweelix-yii2-postmark/feed)WikiDiscussions devel Synced yesterday

READMEChangelogDependencies (3)Versions (10)Used By (0)

Postmark Yii2 integration
=========================

[](#postmark-yii2-integration)

This extension allow the developper to use [PostmarkApp](https://postmarkapp.com/) as an email transport.

[![Latest Stable Version](https://camo.githubusercontent.com/d49d1063d46445db5afe8dc53826448ced8764d325677dc3040968fd12f915b5/68747470733a2f2f706f7365722e707567782e6f72672f737765656c69782f796969322d706f73746d61726b2f762f737461626c65)](https://packagist.org/packages/sweelix/yii2-postmark)[![Build Status](https://camo.githubusercontent.com/8cc6edaaa3b5cdb99017634b74059da363d262078fb422a5d5440c0dd0d6a870/68747470733a2f2f6170692e7472617669732d63692e6f72672f706761756c746965722f796969322d706f73746d61726b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/pgaultier/yii2-postmark)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/f931822d152ebb27ee349a612839363e03503f8b751254e524ca97b0e76398cc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706761756c746965722f796969322d706f73746d61726b2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/pgaultier/yii2-postmark/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/34d6fb19dc85427484eda429ae4d9ddf392531bc73c61296c1f2e91cf22624dd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706761756c746965722f796969322d706f73746d61726b2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/pgaultier/yii2-postmark/?branch=master)[![License](https://camo.githubusercontent.com/0fa65bc71b73af95f74753a026cca95c12c039003f4ad6cd11cca7bc285be7f3/68747470733a2f2f706f7365722e707567782e6f72672f737765656c69782f796969322d706f73746d61726b2f6c6963656e7365)](https://packagist.org/packages/sweelix/yii2-postmark)

[![Latest Development Version](https://camo.githubusercontent.com/da9290457cc26b65f8faba577f924f94512f24929311567c357a38320d6772fd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f756e737461626c652d646576656c2d79656c6c6f77677265656e2e737667)](https://packagist.org/packages/sweelix/yii2-postmark)[![Build Status](https://camo.githubusercontent.com/863c18cf65839052f2b55fdc7df7944a97448da72e2edfbb97a7b2d320d56a1c/68747470733a2f2f7472617669732d63692e6f72672f706761756c746965722f796969322d706f73746d61726b2e7376673f6272616e63683d646576656c)](https://travis-ci.org/pgaultier/yii2-postmark)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8b73a27f4159af7a54f4416ab4d3bf549cda84bb3aef8e6f22299a63eb2871ac/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706761756c746965722f796969322d706f73746d61726b2f6261646765732f7175616c6974792d73636f72652e706e673f623d646576656c)](https://scrutinizer-ci.com/g/pgaultier/yii2-postmark/?branch=devel)[![Code Coverage](https://camo.githubusercontent.com/00c36e2ae2e15942d343139c10b29fc627494c344141e71229a99c3f219317e7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706761756c746965722f796969322d706f73746d61726b2f6261646765732f636f7665726167652e706e673f623d646576656c)](https://scrutinizer-ci.com/g/pgaultier/yii2-postmark/?branch=devel)

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

[](#installation)

If you use Packagist for installing packages, then you can update your composer.json like this :

```
{
    "require": {
        "sweelix/yii2-postmark": "*"
    }
}
```

Howto use it
------------

[](#howto-use-it)

Add extension to your configuration

```
return [
    //....
    'components' => [
        'mailer' => [
            'class' => 'sweelix\postmark\Mailer',
            'token' => '',
        ],
    ],
];
```

You can send email as follow (using postmark templates)

```
Yii::$app->mailer->compose('contact/html')
     ->setFrom('from@domain.com')
     ->setTo($form->email)
     ->setSubject($form->subject)
     ->setTemplateId(12345)
     ->setTemplateModel([
         'firstname' => $form->firstname,
         'lastname' => $form->lastname,
     ->send();
```

For further instructions refer to the [related section in the Yii Definitive Guide](http://www.yiiframework.com/doc-2.0/guide-tutorial-mailing.html)

Running the tests
-----------------

[](#running-the-tests)

Before running the tests, you should edit the file tests/\_bootstrap.php and change the defines :

```
// ...
define('POSTMARK_FROM', '');
define('POSTMARK_TOKEN', '');
define('POSTMARK_TO', '');
define('POSTMARK_TEMPLATE', 575741);

define('POSTMARK_TEST_SEND', false);
// ...
```

to match your [PostmarkApp](https://postmarkapp.com) configuration.

Contributing
------------

[](#contributing)

All code contributions - including those of people having commit access - must go through a pull request and approved by a core developer before being merged. This is to ensure proper review of all the code.

Fork the project, create a [feature branch ](http://nvie.com/posts/a-successful-git-branching-model/), and send us a pull request.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~63 days

Recently: every ~85 days

Total

8

Last Release

3279d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/545714?v=4)[pgaultier](/maintainers/pgaultier)[@pgaultier](https://github.com/pgaultier)

---

Top Contributors

[![pgaultier](https://avatars.githubusercontent.com/u/545714?v=4)](https://github.com/pgaultier "pgaultier (55 commits)")

---

Tags

mailerpostmarkappyii2mailemailmaileryii2postmarkpostmarkapp

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/sweelix-yii2-postmark/health.svg)

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

###  Alternatives

[boundstate/yii2-mailgun

Mailgun integration for the Yii framework

28168.0k](/packages/boundstate-yii2-mailgun)[yarcode/yii2-mailgun-mailer

Mailgun mailer implementation for Yii2

1676.6k](/packages/yarcode-yii2-mailgun-mailer)

PHPackages © 2026

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