someblackmagic / yii2-mailgun
Mailgun integration for the Yii framework
Installs: 66
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 33
Type:yii2-extension
Requires
- guzzlehttp/psr7: ^1.4
- mailgun/mailgun-php: ^2.5.0
- php-http/curl-client: ^1.7
- yiisoft/yii2: >=2.0.4
Requires (Dev)
- roave/security-advisories: dev-master
This package is auto-updated.
Last update: 2024-11-22 02:23:55 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 boundstate/yii2-mailgun "*"
or add
"someblackmagic/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();