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

0.0.3 2024-11-07 08:42 UTC

This package is auto-updated.

Last update: 2024-12-07 08:51:53 UTC


README

This extension provides a Brevo mail solution for Yii framework 2.0.

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

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