Discover how to integrate v0 with Sendinblue effortlessly. Follow our step-by-step guide for configuration tips, best practices, and seamless email marketing integration.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
package.json in your project’s root directory.
"sib-api-v3-sdk": "^8.4.0"
package.json file with this dependency. When the project loads, it will automatically fetch the dependency.
sendinblue.ts in the appropriate folder (for example, in the src directory).sendinblue.ts:
import SibApiV3Sdk from 'sib-api-v3-sdk';
// Configure Sendinblue API Key
const defaultClient = SibApiV3Sdk.ApiClient.instance;
const apiKey = defaultClient.authentications['api-key'];
// Replace 'your-sendinblue-api-key' with your actual API key or use an environment variable
apiKey.apiKey = process.env.SENDINBLUEAPIKEY || 'your-sendinblue-api-key';
/**
- Function to send a transactional email via Sendinblue
- @param toEmail - Recipient's email address
- @param toName - Recipient's name
- @param subject - Subject of the email
- @param htmlContent - HTML content of the email
*/
export function sendEmail(toEmail: string, toName: string, subject: string, htmlContent: string): void {
const apiInstance = new SibApiV3Sdk.TransactionalEmailsApi();
// Create the email object with necessary properties
const sendSmtpEmail = new SibApiV3Sdk.SendSmtpEmail();
sendSmtpEmail.subject = subject;
sendSmtpEmail.htmlContent = htmlContent;
sendSmtpEmail.sender = { email: 'your-email@example.com', name: 'Your Sender Name' };
sendSmtpEmail.to = [{ email: toEmail, name: toName }];
// Trigger the API call to send the email
apiInstance.sendTransacEmail(sendSmtpEmail)
.then((data: any) => {
console.log('Email sent successfully:', data);
})
.catch((error: any) => {
console.error('Error while sending email:', error);
});
}
'your-sendinblue-api-key' and 'your-email@example.com' with your actual API key and sender email address.
main.ts or any file where you handle user actions).sendEmail function from sendinblue.ts at the top of the file:
import { sendEmail } from './sendinblue';
function onUserRegistration(userEmail: string, userName: string): void {
const subject = 'Welcome to Our App';
const htmlContent = 'Welcome!
Thank you for registering with us.
';
// Call the sendEmail function to dispatch the welcome email
sendEmail(userEmail, userName, subject, htmlContent);
}
// Example usage:
// onUserRegistration('newuser@example.com', 'New User');
SENDINBLUEAPIKEY.
onUserRegistration function.When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.