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
Requires
- mailersend/mailersend: ^0.9.1
- yiisoft/yii2: >=2.0.4
Requires (Dev)
- nyholm/psr7: ^1.5
- php-http/guzzle7-adapter: ^1.0
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();
* ~~~