Skip to content

vagrantir/yii2-mailgun

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mailgun

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 boundstate/yii2-mailgun "*"

or add

"boundstate/yii2-mailgun": "*"

to the require section of your composer.json file.

Usage

Configure it in the application configuration:

'components' => [
    ...
    'mailer' => [
        'class' => 'boundstate\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();

About

Mailgun integration for the Yii2 framework

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%