xutl/yii2-mailgun-mailer

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Mailgun Mailer for Yii 2 framework.

Installs: 18

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 23

Type:yii2-extension

1.0.0 2017-03-02 04:17 UTC

This package is auto-updated.

Last update: 2021-11-10 20:14:48 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 xutl/yii2-mailgun-mailer

or add

"xutl/yii2-mailgun-mailer": "~1.0.0"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

<?php
  'components' => [
      'mailer' => [
          'class' => 'xutl\mailgunmailer\Mailer',
          'domain' => 'example.com',
          'key' => 'key-somekey',
          'tags' => ['yii'],
          'enableTracking' => false,
      ],
  ],
?>
<?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();
?>

Thx

https://github.com/mailgun/mailgun-php https://github.com/katanyoo/yii2-mailgun-mailer