dmitxe / yii2-mailgun
Mailgun integration for the Yii framework
Installs: 31
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: ^7.1
- mailgun/mailgun-php: ~3.0
- nyholm/nsa: ^1.1
- nyholm/psr7: ^1.0
- php-http/client-common: ^1.9 || ^2.0
- php-http/discovery: ^1.6
- php-http/guzzle6-adapter: ^2.0
- php-http/multipart-stream-builder: ^1.0
- psr/http-client: ^1.0
- webmozart/assert: ^1.2
- yiisoft/yii2: >=2.0.4
Requires (Dev)
- phpunit/phpunit: ^7.5
This package is auto-updated.
Last update: 2025-02-26 07:40:05 UTC
README
Mailgun integration for the Yii framework. This is fork boundstate/yii2-mailgun
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist dmitxe/yii2-mailgun "*"
or add
"dmitxe/yii2-mailgun": "*"
to the require section of your composer.json
file.
Usage
Configure it in the application configuration:
'components' => [ ... 'mailer' => [ 'class' => 'dmitxe\mailgun\Mailer', 'key' => 'key-example', 'domain' => 'mg.example.com', 'endpoint' => 'https://api.mailgun.net', ], ... ],
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();