How to send personalized product emails: Connecting Shopify, Brevo, and Cloudhooks
Automating customer communications is key for any Shopify store. While Shopify provides basic email capabilities, integrating with a dedicated email service like Brevo unlocks powerful features for personalized transactional and marketing emails.
Brevo (formerly Sendinblue) is a leading email platform serving over 500,000 customers worldwide. When combined with Cloudhooks, you can create sophisticated email workflows triggered by any Shopify event—from order confirmations to product-specific welcome sequences.
In this article, we'll show you how to create an automated email workflow that sends personalized emails based on customer purchases. The example implementation is straightforward but powerful - feel free to improve or tweak it as you see fit.
What you’ll build
In this tutorial, you'll create an automation that:
Monitors your Shopify store for new orders
Extracts customer information and purchase details
Selects a product-specific email template from Brevo
Automatically sends a personalized welcome email to the customer
This integration enables you to:
Send different welcome emails based on specific products
Personalize content using customer data
Track email engagement through Brevo's analytics
Scale your email communications without manual intervention
Time to complete: 20 minutes Difficulty level: intermediate
Prerequisites
A Shopify store with Cloudhooks installed
A Brevo account (free tier available)
Basic understanding of Shopify products and orders
Familiarity with email templates
Set up email templates in Brevo
First, we'll create email templates in Brevo that will be triggered based on specific product purchases. This allows you to send tailored welcome messages depending on what customers buy.
Create your templates
Follow these steps to set up your email templates:
1) Go to the “Campaigns / Templates” page in Brevo.
2) Press "Create Template" to create templates for every product.
3) Design your templates with product-specific content:
Welcome message tailored to the product
Product-specific onboarding instructions
Relevant cross-sell recommendations
Support contact information
Here is how our three templates look in Brevo:
Get template IDs
Each email template in Brevo has a unique identifier that we'll need for our integration:
Open each template from your template list
Look at the URL in your browser
Note the numeric ID that appears after /template/ in the URL
Save these IDs—you'll need them when configuring the hook
💡 Tip: Create a spreadsheet mapping product names to template IDs for easier reference.
Generate API credentials
To allow Cloudhooks to send emails through Brevo:
Navigate to "SMTP & API" in the profile menu
Select "API Keys"
Click "Generate an API key"
Configure the key settings:
Name: "Cloudhooks Integration"
Click "Generate"
Important: Copy and store your API key securely—it won't be shown again
⚠️ Security Note: Never share your API key or commit it to version control. If your key is compromised, generate a new one immediately and update your hook configuration.
Set up Shopify
Create test products
For this tutorial, we'll set up three products in Shopify to demonstrate different email scenarios. You can adapt this to your existing products later.
Go to Products > Add product in your Shopify admin
Create these example products:
Cloudhooks Mug (physical product welcome)
Cloudhooks Pro (software onboarding)
Cloudhooks Unlimited (premium customer welcome)
Get product IDs
Each product needs to be mapped to its corresponding email template:
Open each product from your products list
Find the product ID in the URL (it's the number after /products/)
Create a mapping table:
Product name
Product ID
Template ID
Cloudhooks Mug
123456789
1
Cloudhooks Pro
987654321
2
Cloudhooks Unlimited
456789123
3
💡 Tip: This mapping will be used in your hook configuration to determine which email template to send.
Configure Cloudhooks
Now we'll create an automated workflow in Cloudhooks that sends personalized emails through Brevo whenever a customer places an order. This integration uses Shopify's order creation webhook and Brevo's email API.
Understanding the workflow
When a customer places an order, the hook will:
Capture the order creation event from Shopify
Extract customer details (name, email) and product information
Look up the corresponding email template based on the purchased product
Send a personalized email through Brevo's API
Log the successful email delivery
Create the hook
Follow these steps to set up your automation:
1) Log into your Cloudhooks dashboard
2) Click "Create hook" in the top-right corner
Configure the trigger
1) In the "Trigger" tab:
Navigate to the "Order" category
Select "An order is created"
Click "Select trigger"
💡 Tip: The "An order is created" trigger fires immediately after checkout completion, ensuring timely email delivery.
Add the hook code
Navigate to the "Hook" tab
Copy the template code from the end of this article
Update the configuration constants:
const BREVO_API_KEY = 'your-api-key-here';
const DEFAULT_NAME = 'Valued Customer';
const PRODUCT_TEMPLATE_MAP = {
'123456789': '1', // Mug product ID : template ID
'987654321': '2', // Pro product ID : template ID
'456789123': '3' // Unlimited product ID : template ID
};
⚠️ Important: Double-check your product and template IDs. Incorrect mappings will result in customers receiving the wrong emails.
Configure settings
Switch to the "Settings" tab, and configure the following:
Name: "Product-specific welcome emails via Brevo"
Status: Toggle to "Active"
💡 Best Practice: Use a clear naming convention that indicates both the trigger (new order) and action (Brevo email) for easier management.
Save and activate
Click "Save" in the top-right corner
Verify the hook appears as "Active" in your dashboard
⚠️ Note: After saving, the hook will immediately begin processing new orders. Ensure your email templates and product mappings are correct before activating.
Testing your integration
Before activating the hook for real customers, it's essential to thoroughly test the integration. We'll cover two testing approaches: using the test payload and performing a live test purchase.
Method 1: Test payload simulation
This method allows you to test the integration without making actual purchases:
1) Navigate to the "Hook" tab in your hook configuration
2) In the "Payload" pane on the right, locate these key properties: