naffiq / yii2-mailin
SendinBlue Mailin wrapper for Yii2 framework
1.1.0
2017-04-03 09:02 UTC
Requires
- ext-curl: *
- mailin-api/mailin-api-php: ^v1.0.4
- yiisoft/yii2: ^2.0
Requires (Dev)
- codeclimate/php-test-reporter: ^0.4.4
- phpunit/phpunit: 5.7.0
This package is auto-updated.
Last update: 2024-11-05 22:21:01 UTC
README
SendinBlue Mailin wrapper for Yii2 framework.
Installation
Preferred way to install is through composer
$ composer require naffiq/yii2-mailin
Configuration
Get your API key from SendinBlue account page and insert it into your config file as follows:
<?php return [ // Your config 'components' => [ // ... 'mailin' => [ 'class' => 'naffiq\mailin\Mailin', 'apiKey' => SENDINBLUE_API_KEY, // 'apiUrl' => '' ] ] ] ?>
Usage
To get official SendinBlue library
Mailin object instance, use getClient()
method of component
<?php $mailin = \Yii::$app->mailin->getClient(); // Use $mailin object ?>
Refer to API DOCS (PHP section) for further usage.
Testing
Before running tests with PHPUnit, supply your SendInBlue API key via environmental variable, such as this:
$ MAILIN_API_KEY=your_key phpunit