yarcode/yii2-mailgun-mailer

Mailgun mailer implementation for Yii2

Installs: 73 060

Dependents: 0

Suggesters: 0

Security: 0

Stars: 15

Watchers: 2

Forks: 10

Open Issues: 7

Type:yii2-extension

1.1.3 2018-06-21 10:46 UTC

This package is not auto-updated.

Last update: 2024-10-26 20:26:30 UTC


README

Build Status Latest Stable Version Total Downloads License

Mailgun is a transactional email cloud service. Say goodbye to your usual sendmail or postfix MTA problems. You can start sending emails via cloud without writing any line of code.

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist yarcode/yii2-mailgun-mailer

or add

"yarcode/yii2-mailgun-mailer": "*"

to the require section of your composer.json.

Usage

Configure YarCode\Yii2\Mailgun\Mailer as your mailer.

  'mailer' => [
      'class' => \YarCode\Yii2\Mailgun\Mailer::class,
      'domain' => 'example.org',
      'apiKey' => 'CHANGE-ME',
  ],

Now you can send your emails as usual.

$message = \Yii::$app->mailer->compose()
  ->setSubject('test subject')
  ->setFrom('test@example.org')
  ->setHtmlBody('test body')
  ->setTo('user@example.org');

\Yii::$app->mailer->send($message);

Licence

MIT

Links