itbeauftragter / yii2-nsl-mailgun
NSL Mailgun Extension for Yii2
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- mailgun/mailgun-php: ~3.0
- yiisoft/yii2: >=2.0.4
README
NSL Mailgun Extension for Yii2
Version
Aktuelle Version: 1.0.5
Installation
php composer.phar require --prefer-dist itbeauftragter/yii2-nsl-mailgun "*"
Usage
Configure it in the application configuration:
'components' => [ ... 'mailer' => [ 'class' => 'itbeauftragter\mailgun\Mailer', 'key' => 'key-example', 'domain' => 'mg.example.com', 'endpoint' => 'api.eu.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) ->addTags(['Tag1', 'Tag2']) ->setSubject($form->subject) ->send();