sweelix/yii2-postmark PHP 5.6+ PostmarkApp integration for the Yii framework

mailemailmailerpostmarkpostmarkapp

Postmark Yii2 integration

This extension allow the developper to use PostmarkApp as an email transport.

Latest Stable Version Build Status Scrutinizer Code Quality Code Coverage License

Latest Development Version Build Status Scrutinizer Code Quality Code Coverage

Installation

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

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

Howto use it

Add extension to your configuration

return [
    //....
    'components' => [
        'mailer' => [
            'class' => 'sweelix\postmark\Mailer',
            'token' => '<your postmark 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

Running the tests

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

// ...
define('POSTMARK_FROM', '<sender>');
define('POSTMARK_TOKEN', '<token>');
define('POSTMARK_TO', '<target>');
define('POSTMARK_TEMPLATE', 575741);

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

to match your PostmarkApp configuration.

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 , and send us a pull request.

Changelog

Postmark Yii2 Change Log

1.2.0 July 11, 2017

  • Chg: update dependencies
  • Enh: adding .gitattributes
  • Chg: remove testing on HHVM and PHP 5.6

1.1.3 March 15, 2017

  • Chg: Update dependencies
  • Upd: Update dates

1.1.2 December 6, 2016

  • Chg: Update dependencies

1.1.1 November 2, 2016

  • Chg: Update dependencies

1.1.0 August 3, 2016

  • Chg: Update dependencies
  • Chg: Add getCharset even if not supported by the API (needed for Yii)

1.0.2 June 22, 2016

  • Chg: Update dependencies

1.0.1 April 21, 2016

  • Fix: Docblocks
  • Fix: Interface conformity

1.0.0 April 21, 2016

  • Chg: Initial public release

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.2.0 is the latest of 8 releases



BSD-3-Clause license
Stats
4 github stars & 3 github forks
70 downloads in the last day
1754 downloads in the last 30 days
106177 total downloads