Download the PHP package jlorente/yii2-brevo without Composer
On this page you can find all versions of the php package jlorente/yii2-brevo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jlorente/yii2-brevo
More information about jlorente/yii2-brevo
Files in jlorente/yii2-brevo
Package yii2-brevo
Short Description Yii2 integration for Brevo (Sendinblue) mailer over brevo-php SDK
License MIT
Homepage https://github.com/jlorente/yii2-brevo
Informations about the package yii2-brevo
Yii2 Brevo Mailer
Yii2 mailer connector for Brevo (formerly Sendinblue).
Provides a seamless integration of the official brevo-php SDK into Yii2.
This component lets you send either full custom HTML emails or Brevo transactional templates, and you can deliver them through Brevo’s Transactional REST API (via the official SDK) or through Brevo’s SMTP relay.
Features include dynamic template parameters, custom subjects, attachments, CC/BCC, default sender configuration, and sandbox mode for safe testing.
Installation
Package installation
To install, either run
or
or add
to the section of your composer.json file and run the following command from your project directory.
Component configuration
Then configure the component in your Yii2 application (for example in config/main.php or common/config/main.php):
Basic Usage
Using Brevo Templates
Attachments
Attach a file from disk:
Attach content from memory:
Inline / Embed Notes
- Methods
embed()andembedContent()exist to satisfy the Yii2MessageInterface. - Warning: the Brevo transactional REST API does not support true inline (CID) images.
Calling these methods will log a warning and the resource will be sent as a regular attachment, not as an inline MIME part.
Sandbox Mode
If sandboxEmail (string or array) is configured, every outgoing email is redirected to that address or list of addresses, ignoring the original recipients.
This is useful for development, staging, or automated tests to prevent accidental delivery.
Technical Notes
- Uses the official
getbrevo/brevo-phpSDK. - A default sender (
defaultSender) is applied if noFromaddress is set on the message. guzzleConfiglets you customize the underlying Guzzle HTTP client (timeouts, proxy, etc.).- After sending, you can access the Brevo response via
Message::getLastResponse()or check exceptions withMessage::getLastException(). - Calls to
embed()orembedContent()will log a Yii warning.
Contributing
- Fork the repository.
- Create a feature branch:
git checkout -b feature/my-feature. - Add tests if possible.
- Submit a pull request with a clear description.
License
Copyright © 2025 José Lorente Martín [email protected].
Licensed under the MIT license. See LICENSE.txt for details.