naffiq/yii2-mailin

SendinBlue Mailin wrapper for Yii2 framework

1.1.0 2017-04-03 09:02 UTC

This package is auto-updated.

Last update: 2024-11-05 22:21:01 UTC


README

Build Status Test Coverage Code Climate

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