Send Klaviyo E-mails
In this article we’ll cover:
- How to set up a Klaviyo Flow
- How to add quiz product recommendations inside a Klaviyo e-mail
- How to add quiz questions and customer answers to them in Klaviyo e-mails
- How to set-up Klaviyo segments using Lantern data
Set up a Klaviyo flow
Quiz information is sent over to Klaviyo with several events. The key event that we will use to create the email flow is the Completed lantern quiz (v2) followed by your quiz name.
In this example, our quiz name is Lantern Product Finder Quiz so the event can be found under the name of Completed lantern quiz (v2)- lantern product finder quiz
The event contains arrays with both product recommendations as well as question and answer information that we can use to create dynamic email templates.
Step1: Create a new flow
To get started, from your Klaviyo homepage, head over to Flows on the left-hand side menu.
Next, from the top right-hand side corner click Create flow, followed by Create from scratch and give your flow a name.
Step 2: Select a trigger
On the right-hand side of your new flow you’ll find the Select a trigger section. Go to Your Metrics tab and select API.
This will open up a list of all available events, including events for other active Lantern quizzes. Go through this list until you find the correct Completed lantern quiz (v2) event and select this as your trigger.
Then click Save followed by Confirm and save inside the pop-up.
Step3: Add an email
From the left-hand side menu, under Actions select the Email option and drag and drop this underneath your flow trigger making sure to connect them. Then click Set up email and add an email title.
From here you can also configure optional settings such as preview text, the email sender address, UTM tracking as well as add additional filters to control who receives the email.
Step4: Set up your email template
To start click Select template and either choose from one of the available presets or Create a blank email by clicking this option in the top right-hand corner.
In this example, we opted to create a blank email but the method is the same if using an existing template.
Add Product Recommendations in Klaviyo e-mails
If you prefer, you can follow along with a video tutorial of the steps we show below.
Step 1: Add a section for your results
From the Content tab on the left-hand side menu, select the Table and drag and drop it inside your email template. This will be your results section.
Step2: Connect your table to the quiz data
To do this head over to the Table Settings tab and select the Dynamic option. Then in the Row collection input box enter event.products to connect the quiz recommendation data.
In the Row alias input box enter product
You can copy and paste the following information straight into Klaviyo to connect the table to the quiz data:
Row collection:
event.products
Row collection limited to 3 products:
event.products|slice:'3'
Row alias:
product
Step 3: Add product information
To do this, return to the table’s Content tab. Inside the text cell we’ll enter the custom properties for the product between {{ }}. We’ll start off by entering the {{product.title}} and {{product.price.amount}} as you can see below. It’s easier to add your store currency in front of the {{product.price.amount}}
Now we’re going to add a product image to the right of the text cell by switching to this cell and clicking the Add Dynamic Image/Browse Image button. In the Dynamic variable or dynamic URL input box enter {{product.image}}.
For the image alt text you can add the {{product.title}} and for the link address you can use {{product.url}} to redirect to the product listing if the image is clicked:
Finally, we’ll return to the text cell and add a Buy Now CTA with a link to the {{product.url}}.
For ease, you can copy and paste the following information straight into Klaviyo:
Product title:
{{ product.title }}
Product price:
{{ product.price.amount }}
Product price with 2 decimals:
{{ product.price.amount|floatformat:2 }}
Product image:
{{ product.image }}
Product URL/Link:
{{ product.url }}
Others:
Product price currency:
{{ product.price.currency }}
Step 4: Customize and Preview
You can make customizations to the font size, weight, color and centering and also customize the height and width of your images You can change the number of and type columns in the table and add your product image inside the text column. For more details on available customizations please check out this article.
To see how the email template will look like click the Preview & test button from the top right-hand corner.
Add Quiz Questions & Answers to Klaviyo e-mails
Alternatively, you can follow along with the video version of this part of the tutorial.
Step 1: Add a section for your questions and answers
From the Content tab on the left-hand side menu, select the Table and drag and drop it inside your email template. This will be your question and answer summary section.
Step2: Connect your table to the quiz data
To do this head over to the Table Settings tab and select the Dynamic option. Then in the Row collection input box enter event.answers to connect the quiz recommendation data.
In the Row alias input box enter answer
You can copy and paste the following information straight into Klaviyo to connect the table to the quiz data:
Row collection:
event.answers
Row alias:
answer
As we won’t need 2 columns, we’ll go ahead and delete the second one containing the image:
Step 3: Add custom properties for questions and answers
To do this, return to the table’s Content tab. Inside the text cell we’ll enter the custom properties between {{ }}. We need to use the {{answer.question}} and {{answer.answer}} properties. For clarity, we’ll add the words Question: and Answer: just before the actual values:
For ease, you can copy and paste the following information straight into Klaviyo:
Questions:
{{ answer.question}}
Answers:
{{ answer.answer }}
To see how the email template will look like click the Preview & test button from the top right-hand corner.
Step 4: Customize and Preview
To see how the email template will look like click the Preview & test button from the top right-hand corner.
You can make customizations to the font size, weight, color, and centering. You can add padding to your columns, and change the number of and type columns in the table For more details on available customizations please check out this article.
Klaviyo segments using Lantern data
Step1: Create a new Segment
First, log in to your Klaviyo account. From the dashboard, on the left-hand side menu locate and click on the 'Lists & Segments' option underneath.
Then, click on the 'Create List/Segment' button to start creating a new segment. After clicking on 'Create List/Segment', you will be presented with two options: 'List' and 'Segment'. Choose the 'Segment' option since we are creating a new segment based on certain properties.
Step2: Create Segment Rules
For our purposes, we'll be using properties provided by Lantern. These properties include:
1. Quiz Answers: Use these to create segments based on the responses customers have provided during the quiz
For instance, to create a segment for customers who selected allergies as their answer to question 1, choose 'Properties about someone' -> 'Answer(1)' -> 'Equals', and then select the ‘Allergies’ from the second drop-down.
You can create segments based on a sequence of quiz answers by adding new rules:
2. Recommended Products: Segment customers based on the products recommended to them.
In our example, we’re interested in creating a segment for the customers who have been recommended Cloud Cradle Soft Memory Foam Medium Pillow as one of their quiz results. For this, we will use the ProdcutName property.
We show a total of 3 results in the quiz so we want to include all customers that have been recommended this product regardless if it was their 1st, 2nd or 3rd result.
3. Quiz Questions: Segment customers based on the questions they were asked during the quiz.
This is especially relevant if you have logic jumps in your quiz and you know only certain customers will be asked certain questions based on their previous answer selection. You can use this to create a rule based on what that question would be for this specific group of customers using the Question property:
4. Product Information: Use the price, Shopify product ID, or store URL of the recommended results as a base for your segmentation. The respective properties are: Price, ProductID and Url.
Please note: Whilst most of our properties are text properties, when using Price the type should be changed to number.
Step3: Name and Create your Segment
Give your new segment a specific name that clearly indicates its purpose. Once you've named the segment, save and create it by clicking the Create Segment button.
Once your segment is created, it's dynamic - meaning it updates as customers meet or no longer meet the defined criteria. This allows your email campaigns to adapt to these segments, automatically adding new customers who meet the segment's rules.
By integrating data from your Lantern quiz, you can create highly targeted segments in Klaviyo that increase the relevance and effectiveness of your email marketing. Remember to regularly revisit and refine your segments to ensure they continue to deliver value to your campaigns.
For more information on creating Klaviyo segments please check out the following article.