deno028/yii2-mailersend

Yii2 Extension for Mailersend

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

1.0.2 2023-04-14 07:23 UTC

This package is auto-updated.

Last update: 2024-04-24 15:18:14 UTC


README

Yii2 Extension for Mailersend

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist deno028/yii2-mailersend "*"

or add

"deno028/yii2-mailersend": "*"

to the require section of your composer.json file.

Usage

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

 * Mailer implements a mailer based on MailerSend.
 *
 * To use Mailer, you should configure it in the application configuration like the following,
 *
 * ~~~
 * 'components' => [
 *     ...
 *     'mailer' => [
 *         'class' => 'deno028\mailersend\Mailer',
 *         'key' => 'key-example',
 *     ],
 *     ...
 * ],
 * ~~~
 *
 * 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();
 * ~~~