Back to Mindsdb

Sendinblue

docs/integrations/app-integrations/sendinblue.mdx

26.1.01.8 KB
Original Source

In this section, we present how to connect Sendinblue to MindsDB.

Brevo (formerly Sendinblue) is an all-in-one platform to automate your marketing campaigns over Email, SMS, WhatsApp or chat.

Data from Sendinblue can be used to understand the impact of email marketing.

Prerequisites

Before proceeding, ensure the following prerequisites are met:

  1. Install MindsDB locally via Docker or Docker Desktop.
  2. To connect Sendinblue to MindsDB, install the required dependencies following this instruction.
  3. Install or ensure access to Sendinblue.

Connection

This handler is implemented using the sib-api-v3-sdk library, a Python library that wraps Sendinblue APIs.

The required arguments to establish a connection are as follows:

  • api_key: a required Sendinblue API key to use for authentication
<Tip> Check out [this guide](https://developers.brevo.com/docs) on how to create the Sendinblue API key.

It is recommended to use the API key to avoid the API rate limit exceeded error. </Tip>

Here is how to connect the SendinBlue to MindsDB:

sql
CREATE DATABASE sib_datasource
WITH ENGINE = 'sendinblue',
PARAMETERS = {
  "api_key": "xkeysib-..."
};

Usage

Use the established connection to query your database:

sql
SELECT * FROM sib_datasource.email_campaigns

Run more advanced queries:

sql
SELECT  id, name
FROM sib_datasource.email_campaigns
WHERE status = 'sent'
ORDER BY name
LIMIT 5
<Info> For more information about available actions and development plans, visit [this page](https://github.com/mindsdb/mindsdb/blob/main/mindsdb/integrations/handlers/sendinblue_handler/README.md). </Info>