This article will discuss how to send quiz recommendations to customers' email using Klaviyo. The following variables can be populated in the email.
Variable Name | Variable Code |
Quiz Name | {{ event|lookup:'Quiz Name'|default:'' }} |
Product Name | {{ event|lookup:'Recommended Products'|lookup:'0'|lookup:'Product Name'|default:'' }} |
Product Image Url | {{ event|lookup:'Recommended Products'|lookup:'0'|lookup:'Product Image Url'|default:'' }} |
Product URL | {{ event|lookup:'Recommended Products'|lookup:'0'|lookup:'Product URL'|default:'' }} |
Product ID | {{ event|lookup:'Recommended Products'|lookup:'0'|lookup:'ProductID'|default:'' }} |
Question | {{ event.0.question|default:'' }} |
Answer | {{ event.0.answer|default:'' }} |
Note: Adjust the lookup value to pull in the value for each corresponding product that has been recommended. "0" represents the first product, "1" the second, "2" the third and so forth.
In this article, you'll learn about:
Sending quiz recommendations to customers
Open Klaviyo and create a new flow with the trigger Submitted Okendo Quiz.
Drag and drop a new email into the flow, and click edit.
3. Drag a table block into the email.
4. Navigate to the Table Settings > Dynamic and fill out the Row collection and Row alias. These variables are case-sensitive and must be entered as below.
event|lookup:'Recommended Products'
Product
5. Navigate to Content > Dynamic Rows > select the right column and set the Cell Content to an Image. Add a dynamic image and insert the following URL:
{{ Product|lookup:'Product Image Url'|default:'' }}
To link to the product description page, insert the following variable in the Link address field. Set the Max width of the products to size them as required.
{{ Product|lookup:'Product URL'|default:'' }}
6. Select the left column under Dynamic Rows and set the Cell Content to Text. Enter the below variable in the text field.
{{Product|lookup:'Product Name'|default:'' }}
Using the following variable, you may also hyperlink the product name (above text) to the product description page.
{{ Product|lookup:'Product URL'|default:'' }}
7. Preview the changes. The product name, image and link to the product description page should populate correctly.
Displaying quiz questions and answers
Drag a text block into the email.
Paste the following variables into the block.
{{ event.0.question|default:'' }}
{{ event.0.answer|default:'' }}
{{ event.1.question|default:'' }}
{{ event.1.answer|default:'' }}
{{ event.2.question|default:'' }}
{{ event.2.answer|default:'' }}
{{ event.3.question|default:'' }}
{{ event.3.answer|default:'' }}
Keep in mind that you can customize the variables depending on how many questions and answers you'd like to show.
2. Preview the changes and ensure that it's populating correctly.
Linking to the quiz's recommendation page
A link or button can be added to the email for the quiz taker to view their recommendations on site. The quiz response ID variable is sent through with the Submitted Okendo Quiz event:
โ
{{ event|lookup:'Quiz Response ID'|default:'' }}
A combination of the page URL that the quiz is installed on, the query string ?okendo_quiz_response_id=
and quiz response ID will be required together to create the link.
For example:
โ
https://okendocosmetics.com/pages/custom-beauty-recommendation?okendo_quiz_response_id={{ event|lookup:'Quiz Response ID'|default:'' }}