Marcio Cunha

How to Create Visual Templates in Brevo and Trigger Them via API Calls

Learn the step-by-step process to design email layouts in Brevo's visual builder and automate transactional or bulk sending using API calls with JSON payloads.

Marcio Cunha12 min
Also available in:EspañolPortuguês
Summary
  • Brevo's visual editor eliminates the need to code raw HTML emails from scratch.
  • Numeric template identifiers ensure an exact connection between the visual interface and backend code.
  • Dynamic variables within the email body allow personalized messages for each individual recipient.
  • The API key acts as a security badge authorizing external systems to communicate with the platform.
  • Proper handling of API errors prevents silent failures when dispatching critical user messages.

The Challenge of Unifying Visual Design and API Automation

When developing systems that need to send automated emails, such as purchase receipts, password resets, or security alerts, we often encounter a classic dilemma. On one hand, product and design teams demand impeccable, responsive visual layouts that are easy to modify. On the other hand, developers need clean, stable code capable of triggering these messages programmatically without manual intervention. In practice, this means we need a robust bridge between visual email marketing tools and backend systems.

Brevo, formerly known as Sendinblue, resolves this friction by providing an ecosystem that separates design creation from mailing logic. The process involves designing the template graphically in their web interface, capturing the generated numeric identifier, and then using an HTTP POST request to trigger the dispatch. In this article, we will explore the complete practical workflow to design your layout, configure dynamic variables, and implement integration code via API.

Designing the Layout in Brevo's Visual Builder

The first step takes place entirely inside the Brevo administrative dashboard. Under the Campaigns or Transactional section, the drag-and-drop visual builder allows anyone to assemble elegant emails without writing a single line of raw HTML. In practice, the tool generates underlying structured code compatible with dozens of different email clients, such as Gmail, Outlook, and Apple Mail.

Upon finishing the design, the platform assigns a unique identification number to the template, known as the Template ID. It is precisely this number that we will pass to our external system so it knows which layout to use at dispatch time. Furthermore, this is where we define placeholder spaces for personalization, allowing structured data to replace generic texts at the moment of sending.

Using Dynamic Variables for Mass Personalization

Generic messages usually end up in the spam folder or are ignored by users. To prevent this, Brevo allows the insertion of dynamic variables into visual templates using a specific syntax based on double curly braces, such as {{