Brevo
Add people from your forms to Brevo lists or take them off, send them a template email, or track an event.
Brevo sends each form submission to your Brevo account. An action can add the contact to lists, unsubscribe them, send them a template email, or record an event that starts a Brevo automation. It needs XPAC Forms.
Connect Brevo
In Brevo, open Settings → SMTP & API and generate a new key on the API keys tab (app.brevo.com/settings/keys/api). Copy it right away: Brevo shows it only once.
If your Brevo account blocks unknown IP addresses, add this server's IP under Security → Authorized IPs in Brevo. Otherwise Brevo refuses every request.
In WordPress, go to XPAC → Integrations → Brevo, paste the key into API key and save. Admins can see the saved key on this screen.
Click Test connection. It shows how many lists the key can see and whether Brevo has an active double opt-in template. It sends nothing.
Webhook secret is optional. Enter any long random string, then add a webhook
in Brevo for unsubscribes, hard bounces and spam reports that points at
https://your-site.com/wp-json/xpac/v1/form/brevo/webhook?token= followed by that
string. The site then keeps a list of those addresses, which custom code can use
(see For developers). Tools → Export Personal Data and
Tools → Erase Personal Data cover the list.
Add it to a form
Edit the form, open the Brevo panel in the sidebar and click Add Brevo action. Only an administrator can add or change Brevo actions. Pick the Action:
Subscribe contact
- Add to lists: one or more lists. Lists, attributes and templates are kept for 10 minutes. Click Reload from Brevo to fetch them again.
- Update existing contacts: on by default. Off, existing contacts join the lists but keep their current details.
- Resubscribe contacts: lets people who unsubscribed get email again. It turns on Update existing contacts.
- Require confirmation (double opt-in): needs an active double opt-in template in Brevo. Enter its Confirmation template ID and Redirect after confirming, the full URL of the page people see after they confirm. Brevo adds them to the lists once they confirm.
- Field mapping: pair each Form field with a Brevo attribute. One row must map to EMAIL. Empty answers keep the values Brevo already has.
- Phone attributes (SMS, WHATSAPP, LANDLINE_NUMBER) need a country code. A US-format Phone field gets +1. A number without a country code is left out, and the delivery gets a note. A Smart international Phone field already sends +CC numbers, and a phone format from an add-on that declares a country code gets that code.
Unsubscribe contact
- Email address field: the form field with the contact's email.
- Remove from lists: the lists to take them off.
- Stop all marketing email: blocks marketing email to them across all lists. On by default.
Send template email
- Email address field: who gets the email.
- Template: one of your active Brevo templates.
- Template parameters: pair a Form field with a Parameter name, used in
the template as
{{ params.NAME }}.
Track event
- Email address field: who the event is about.
- Event name: letters, numbers, - and _. Use the same name as the trigger in your Brevo automation.
- Event properties: pair a Form field with a Property name.
Click Save, then update the form. Each action has a switch to turn it off, and Edit Brevo action and Remove Brevo action buttons. With Forms' conditional logic, an action can run only when the answers match. The XPAC Agent can add these actions for you too.
When a send fails
XPAC saves every submission first and sends it to Brevo in the background, so a Brevo problem never loses a submission. Each send is listed under XPAC → Forms → Deliveries:
- Delivered: Brevo took it. A note says when something was left out, such as a phone number without a country code, or an existing contact whose details Brevo did not update.
- Waiting: queued, or waiting to try again. When Brevo is busy or can't be reached, XPAC tries again after about 1, 5, 30 and 120 minutes.
- Failed: every try failed, or Brevo refused it, for example an address that is not valid or a double opt-in template that is switched off. The row says why.
- Skipped: there was nothing to send, such as a submission with no email address.
- Dismissed: you dismissed it, or the submission is in spam or the trash.
Retry now sends a failed or dismissed delivery again with the form's current settings and the API key saved now. Actions that already went through are not sent again unless you edited them since.
If five deliveries in a row fail because of the account or the connection, such as a revoked key or Brevo being down, XPAC pauses Brevo on that form. A problem with one person's answers never counts. While it is paused, submissions are still saved but show as Failed, and the site's admin email address gets one email about it. XPAC still tries one submission an hour, and Brevo starts sending again on its own if that one goes through. To resume now, fix the cause and click Resume and retry on the Deliveries screen. It sends the failed submissions again with the form's current settings.
For developers
| Hook | Type | What it does |
|---|---|---|
xpac_brevo_payload | Filter | Change a request before it is sent. Gets the body, the action (subscribe, unsubscribe, sendEmail or trackEvent), the action's settings and the submission. |
xpac_brevo_skip_suppressed | Filter | Return true to stop subscribing addresses the webhook reported. Default false. |
xpac_brevo_writable_attribute_categories | Filter | Which Brevo attribute categories the editor offers. Default normal, transactional and category. |
xpac_brevo_check_double_optin | Filter | Whether Test connection also looks for a double opt-in template. Default true. |
xpac_brevo_request_timeout | Filter | Seconds to wait for Brevo. Default 10. |
xpac_brevo_webhook | Action | Every event from a verified webhook. Gets the event name, the email and the event. |
xpac_brevo_contact_suppressed | Action | Brevo reported an address as unsubscribed, hard_bounce or spam. Gets the email, the reason and the event. |