farmani / yii2mailgunmailer
Mailgun Mailer for Yii 2 framework.
Installs: 9 844
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
Type:yii2-extension
Requires
- mailgun/mailgun-php: 1.8
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2022-02-01 12:51:07 UTC
README
Mailgun mailer for Yii 2 framework.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist farmani/yii2mailgunmailer "*"
or add
"farmani/yii2mailgunmailer": "*"
to the require section of your composer.json
file.
Config
'components' => [ ... 'mailer' => [ 'class' => 'farmani\yii2mailgunmailer\Mailer', 'domain' => 'example.com', 'key' => 'key-somekey', 'tags' => ['yii'], 'enableTracking' => false, ], ... ], ?>``` Usage ----- Once the extension is installed, simply use it in your code by : ```php <?php Yii::$app->mailer->compose('<view_name>', <option>) ->setFrom("<from email>") ->setTo("<to email>") ->setSubject("<subject>") // ->setHtmlBody("<b> Hello User </b>") // ->setTextBody("Hello User") ->send(); ?>```