Skip to content

dadolun95/magento2-brevo-sendinblue

Repository files navigation

Brevo (formerly Sendinblue) - Magento2 integration module magento

Latest Stable Version

Features

Syncronization functionality for Brevo (formerly Sendinblue) - Magento2 integration. This module integrates your Magento2 site with Brevo allowing you to refine your marketing strategy, create automations on many scenarios and create campaigns based on your Magento e-commerce site data.

  • Simplified module configuration
  • Sendinblue PHP SDK usage
  • Debug log feature
  • Autonomous synchronization of subscribers data on Brevo
  • Autonomous synchronization of every subscriber quote and order data on Brevo
  • Implementation of synchronous vs asynchronous data synchronization on Brevo avoiding bottlenecks
  • Pageview tracking and user navigation tracking on Brevo
  • Cart events synchronization (allow you to manage abandoned carts automations)

Compatibility

Fully tested and working on Magento CE(EE) 2.4.4, 2.4.5, 2.4.6

Installation

You can install this module adding it on app/code folder or with composer.

composer require dadolun95/magento2-brevo-sendinblue

Then you'll need to enable the module and update your database and files:

php bin/magento module:enable Dadolun_SibCore Dadolun_SibContactSync Dadolun_SibOrderSync
php bin/magento setup:upgrade
php bin/magento setup:di:compile
CONFIGURATION

You must enable the module from "Stores > Configurations > Dadolun > Brevo > General" section adding you Brevo API key: image image With the debugger option enabled the module will log each API v3 call result and response code and also observer calls on a dedicated file localed on /var/log/sendinblue-integration.log file. Remember that letting the debugger enabled on production enviroment can slow down the website.

Enable Brevo visitor tracking in order to register each customer pageview on Brevo via API (always synchronous and client-side): image image Remember to enable tracking on Brevo, then copy you client key from the js snippet on Magento configurations: image image

Mandatory: You must enable contact sync after the initial setup for newsletter subsription synchronization on Brevo: image Choose between "Sync" and "Async" Synchronization type.

  • "Sync" mode (not recommended) will create or update subscriber data on Brevo synchronously at each magento2 event (subscription update / order update) making an API call to Brevo
  • "Async" mode (recommended) use Magento2 message queue system with a dedicated MySQL-operated queue (See here message queue configuration guide) so you need to configure also magento to use consumer properly updating your app/etc/env.php file (something like that):
...
    'cron_consumers_runner' => [
        'cron_run' => true,
        'max_messages' => 1000,
        'consumers' => [
            'sibContactProcessor',
            'sibOrderProcessor',
        ]
    ],
...

The module provides a "Sync contact" CTA on adminhtml that move all existing contacts to Brevo (only new subscribers are synced on runtime). The "Sync contact" CTA use Magento2 message queue system. So, clicking "Sync Order" you'll only add a complete order synchronization request on queue. If you had choose the Synchronous mode and you've not configured message queue system on your Magento installation, you will need to run this command from your cli each time you want to perform a complete "Contact Sync" request from adminhtml:

php bin/magento queue:consumers:start sibContactProcessor

Since Contact synchronization functionality is enabled two Brevo lists are created:

  • [Magento Optin Form] > Temp - DOUBLE OPTIN (contacts that need confirmation are moved here temporarely)
  • [magento] > subscriptions Complete the contact sync configuration choosing the Brevo list where you want to synchronize your contacts (subscriptions created list is recommended). You can also create new lists and folders on Brevo and select it differently for each Magento store configured (Ex: subscriptions_USA for a website working in United States, and subscriptions_EU for a website working in Europe). image

You can enable the order sync from "Stores > Configurations > Dadolun > Brevo > Order Sync" section. image Like contact sync pay attention to the "Sync Type" configuration, you must choose between "Async" and "Sync" mode. It's recommended to keep contact sync and order sync on same synchronization mode (Async or Sync). If you don't have configured message queue system on your Magento installation (like written above), you will need to run this command from your cli each time you want to perform an "Order Sync" request from adminhtml:

php bin/magento queue:consumers:start sibOrderProcessor

Enabling "Track Abandoned carts on Brevo" allow you to register events to Brevo tracking trought client-side API. Below events are managed:

  • cart_created
  • cart_deleted
  • cart_updated
  • order_completed image Once enabled you need to create the "Abandoned Cart" automation on Brevo. image image Configuring right event on each step:
  • 1 Entry point image
  • 2 Delay image
  • 3 Email Setup image
  • 4/5 Scenario's exit events image image
  • 6 Scenario's restart event image Activate the automation image Customize the "Abandoned cart" email template image That's all, you're now able to manage your Magento abandoned cart notifications with Brevo automations.
SMTP CONFIGURATION

For Magento 2.4.4 and Magento 2.4.5 you can install Mageplaza or Magepal SMTP modules. Use Magento core SMTP configuration feature for 2.4.6 and newer versions instead. Brevo SMTP settings are located on "Transactional > Settings" section: image image

Contributing

Contributions are very welcome. In order to contribute, please fork this repository and submit a pull request.