/lovable-integrations

Lovable and Sendinblue integration: Step-by-Step Guide 2025

Discover how to integrate Lovable with Sendinblue effortlessly. Follow our step-by-step guide to boost your email marketing and automation.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to integrate Lovable with Sendinblue?

 

Step 1: Creating the Sendinblue Service File

 

This step instructs you to create a new TypeScript file where you will write the code integrating the Sendinblue API with your Lovable project.

If your project has a folder for service files (for example, a folder named "services"), create a new file inside it called sendinblue.ts. If there is no such folder, you can create the file in the root directory of your project.

Paste the following code into the file sendinblue.ts. This code creates a SendinblueService class that will be responsible for sending emails via Sendinblue. It uses the built‐in fetch function so there is no need to install additional libraries.


export class SendinblueService {
  private apiKey: string;
  private apiUrl: string = 'https://api.sendinblue.com/v3';

constructor(apiKey: string) {
this.apiKey = apiKey;
}

async sendEmail(to: string, subject: string, content: string): Promise {
const payload = {
sender: { email: "yourverifiedsender@example.com" }, // Replace with your Sendinblue verified sender email
to: [{ email: to }],
subject: subject,
htmlContent: content,
};

const response = await fetch(${this.apiUrl}/smtp/email, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'api-key': this.apiKey,
  },
  body: JSON.stringify(payload)
});

if (!response.ok) {
  throw new Error(Sendinblue API error: ${response.statusText});
}

return response.json();

}
}

Remember to replace [email protected] with the sender email you have verified in your Sendinblue account.

 

Step 2: Using the Sendinblue Service in Your Lovable Project

 

Now you need to integrate the Sendinblue service into your project code where you want to send emails. For example, if your Lovable project has a contact form and a corresponding TypeScript file (e.g., index.ts or a dedicated form handler file), add the following code.

If there is no terminal available in Lovable, simply copy the following code snippet into your existing TypeScript file where you handle form submissions.


import { SendinblueService } from './sendinblue';

// Instantiate the SendinblueService with your API key.
// Replace 'YOURSENDINBLUEAPI_KEY' with the actual API key provided in your Sendinblue account.
const sendinblueService = new SendinblueService('YOURSENDINBLUEAPI_KEY');

// Example function: Handles the form submission to send an email.
async function handleFormSubmit(event: Event) {
event.preventDefault();

// Assuming you have input fields with the IDs 'email', 'subject', and 'message' in your HTML form.
const emailField = document.getElementById('email') as HTMLInputElement;
const subjectField = document.getElementById('subject') as HTMLInputElement;
const contentField = document.getElementById('message') as HTMLInputElement;

try {
const result = await sendinblueService.sendEmail(
emailField.value,
subjectField.value,
contentField.value
);
console.log('Email sent successfully:', result);
// Optionally, show a success message to the user.
} catch (error) {
console.error('Error sending email:', error);
// Optionally, display an error message to the user.
}
}

// Attach the form submit event listener.
// Ensure that your HTML form has the ID 'contactForm'.
const form = document.getElementById('contactForm');
if (form) {
form.addEventListener('submit', handleFormSubmit);
}

This snippet imports the previously created Sendinblue service, instantiates it with your API key, and attaches a submit event listener to your form. Adjust the element IDs (email, subject, message, and contactForm) to match your actual HTML.

 

Step 3: Setting Up Your Sendinblue API Key

 

Instead of using a terminal to install dependencies, you should store your Sendinblue API key directly in the code. In the snippet from Step 2, replace 'YOURSENDINBLUEAPI_KEY' with the API key you received in your Sendinblue account.

For added security, if your no-code tool supports environment variables or secret management, look for a way to store your API key securely rather than hardcoding it. If not, ensure your project is protected and the key is not shared in public repositories.

 

Step 4: Testing the Integration

 

After adding the files and updating the necessary placeholders, test your Sendinblue integration:

- Open the page containing your contact form in Lovable.

- Fill in the form fields and submit the form.

- Monitor the console (using the inbuilt debugging tools of Lovable if available) to check if the email sending process logs "Email sent successfully" or displays any error messages.

If an error occurs, re-check your API key, the sender email, and the HTML element IDs referenced in the code snippets.

Still stuck?
Copy this prompt into ChatGPT and get a clear, personalized explanation.

This prompt helps an AI assistant understand your setup and guide you through the fix step by step, without assuming technical knowledge.

AI AI Prompt

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022