moein7tl/yii2-mailgun

This package is abandoned and no longer maintained. No replacement package was suggested.

Mailgun integration for the Yii2 framework

Installs: 6 055

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 31

Type:yii2-extension

v0.0.4 2017-04-21 20:28 UTC

This package is not auto-updated.

Last update: 2021-11-19 23:46:48 UTC


README

Mailgun integration for the Yii framework

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist moein7tl/yii2-mailgun "*"

or add

"moein7tl/yii2-mailgun": "*"

to the require section of your composer.json file.

Usage

Configure it in the application configuration:

'components' => [
    ...
    'mailer' => [
        'class' => 'moein7tl\mailgun\Mailer',
        'key' => 'key-example',
        'domain' => 'mg.example.com',
    ],
    ...
],

To send an email, you may use the following code:

Yii::$app->mailer->compose('contact/html', ['contactForm' => $form])
    ->setFrom('from@domain.com')
    ->setTo($form->email)
    ->setSubject($form->subject)
    ->send();