schuetzenlust / yii2-brevo
Brevo integration for Yii2
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=8.1
- getbrevo/brevo-php: ^2.0.3
- yiisoft/yii2: >=2.0.48
README
This extension provides a Brevo mail solution for Yii framework 2.0.
Installation
The preferred way to install this extension is through composer.
composer require Schuetzenlust/yii2-brevo
Usage
To use this extension, simply add the following code in your application configuration:
return [ //.... 'components' => [ 'mailer' => [ 'class' => 'schuetzenlust\brevo\Mailer', 'apikey' => 'your-api-key', ], ], ];
You can then send an email as follows:
Yii::$app->mailer->compose('contact/html', ['contactForm' => $form]) ->setFrom('from@domain.com') // or ->setFrom(["name" => "Your name", "email" => "yourmail@example.com"]) ->setTo($form->email) // or ->setTo(["name" => "Your name", "email" => "yourmail@example.com"]) ->setSubject($form->subject) ->send();
Batch Sending
Yet to be implemented