Brevo integration

Store and organize your contacts while protecting user privacy on Brevo, the leading CRM & email marketing platform in Europe. Brevo offers unlimited contacts and advanced marketing features.

  1. Connecting to the API
  2. Setting up your contact forms
  3. Contact attribute–form field mapping
  4. Privacy considerations
  5. Troubleshooting

Disclosure: The author of this post is a Brevo Affiliate, meaning we get a commission if you decide to make a purchase through the links, at no cost to you.

Connecting to the API

This integration module uses the Brevo API (v3). To access the API, you need an account with Brevo. If you don’t have one yet, create a free account first. You can upgrade the account any time it becomes necessary.

After creating your account, log in to the Brevo dashboard and navigate to the SMTP & API page. You’ll find your v3 API key there. This key is used in the next step, so copy it now.

Screenshot of the "SMTP & API" page
Screenshot of the “SMTP & API” page

Then open a new browser tab and log in to your WordPress dashboard. Navigate to Contact > Integration menu page and click Setup integration in the Brevo box. You’ll find an input field there. Paste the API key into the field and click Save changes.

Screenshot of the Integration page
Screenshot of the Integration page

Now the Brevo API is available through your contact forms. The next step is setting up each contact form.

Setting up your contact forms

After activating the Brevo API, you’ll find a newly-created tab in the contact form editor screen. With this Brevo tab panel, you can control this integration module’s two major functions: contact lists and welcome email.

Screenshot of the Brevo tab panel
Screenshot of the Brevo tab panel

If the Contact lists checkbox is selected, the submitter will be added to your contact lists after the contact form is submitted. You can also indicate to which lists the contact will be added.

If the Welcome email checkbox is selected, Contact Form 7 will send a welcome email to new contacts. The welcome email is sent only when the submitter is successfully added to the contact lists.

The welcome email uses Brevo’s email template system, which lets you compose a fully-personalized, elegant HTML email. Also, the email is delivered via Brevo’s reliable SMTP infrastructure, which allows you to track the status of your email after sending it.

Note: Contact Form 7 only uses Brevo’s SMTP for the welcome email for new contacts. Emails other than the welcome email use WordPress’ built-in wp_mail() function. If you want to use Brevo’s SMTP for every email on WordPress, install Sendinblue’s official WordPress plugin.

Contact attribute–form field mapping

Brevo’s contact data is composed of four basic attributes (EMAIL, FIRSTNAME, LASTNAME, and SMS) and user-defined additional attributes. When you create a new contact based on a form submission, those contact attributes are retrieved from user-input values.

For example, the EMAIL attribute is retrieved from the ‘your-email’ field. In the same way, an attribute is retrieved from the form field whose name contains a ‘your-‘ prefix + the lowercased attribute name.

Additionally, FIRSTNAME and LASTNAME have a special mapping rule. For cases where the form doesn’t contain a ‘your-firstname’ or ‘your-lastname’ field but the ‘your-name’ field instead, the first word of the ‘your-name’ field value is used for the FIRSTNAME attribute, and the remainder is used for the LASTNAME attribute. So, for example, if “Vincent van Gogh” was input to the ‘your-name’ field, the FIRSTNAME would be “Vincent”, and the LASTNAME would be “van Gogh”.

Also be aware that the SMS attribute value must be specified as an international telephone number with the proper country code (for example: +91xxxxxxxxxx or 0091xxxxxxxxxx). If you have an input field for SMS and the user input wasn’t in the correct format, the API request to create a contact will fail.

The parameters used in an email template follow the same mapping rules. If you have a {{ params.SIZE }} placeholder in your email template, the ‘your-size’ field value will replace the placeholder in the email.

Lastly, you can customize this entire mapping using the wpcf7_sendinblue_collect_parameters filter hook.

Privacy considerations

You are strongly advised to obtain explicit consent from the form submitter before adding their personal data to your contact list. Not only is it illegal to collect personal data without consent, but a high spam complaint rate may also occur if emails are delivered to unintended receivers.

Contact Form 7 provides the consent_for:sendinblue form-tag option to check the submitter’s consent, an example of which is provided below:

[acceptance your-consent optional consent_for:sendinblue]
It's OK to add me to your contact list.
[/acceptance]

If you have this form-tag (acceptance checkbox) in your contact form, Contact Form 7 sends the contact data to the Brevo API only when the submitter has selected the checkbox to confirm their consent.

You can also use double opt-in by activating another WordPress plugin called Double Opt-In Helper.

Troubleshooting

Problem: No contact data is created on Brevo.

First, make sure that a connection to the Brevo API is established as described above. If it is OK, then go to the contact form editor page and check if the Contact lists checkbox is selected in the Brevo tab panel. If not, nothing will be sent to the API, therefore contact data will not be created. Also, make sure that the your-email field exists in the form template.

If all is set up correctly, make sure that you submit the form with a unique email address. If a contact data with the same email already exists in Brevo’s database, the API will not update the existing contact data (this is because the updateEnabled parameter is set to false by default), and will ignore the contact creation request.

Problem: Contact data is created, but some attributes are not filled.

As described in the above section, there is a mapping rule that defines which user input value fills which contact attribute. If you find some attributes unfilled, make sure you have corresponding input fields in the form.

In addition to this, note that non-English users of Brevo may have different attribute names than the ones in the above description. If you use Brevo in French, for example, you may have the “PRENOM” attribute instead of “FIRSTNAME”. Even in such cases, the general mapping rule of ‘your-‘ + the attribute name in lower case is applied, thus you need to add the your-prenom field to the form instead of the your-firstname field.

Just another contact form plugin for WordPress. Simple but flexible.