Hello @Lasse,
Welcome to the Klaviyo Community!
From your scenario it does sound like using a metric-triggered flow would achieve your goal. Does this third-party tool happen to have an integration with Klaviyo or have you created a custom integration for this tool to send events to Klaviyo using our Track API?
I believe the misunderstanding here with not finding an appropriate flow trigger you want to use is that the third-party tool may not be connected to your Klaviyo account and/or it’s not sending any events/data to Klaviyo yet. You would not be able to act on data that is not already recorded or shared with Klaviyo. This means even if you did already set up your own custom integration to connect this third-party tool with Klaviyo, if there hasn’t been any events or data recorded in Klaviyo from this tool, you wouldn’t see this event as an available trigger when creating your flow. For this reason, it’s typically common to manually text your custom integration in order to record an event in Klaviyo.
Additionally, if you were testing your own custom integration, but aren’t seeing an event recorded, you may want to review how your custom integration is set up with your developer. I would also suggest taking a look at some of our additional resources on creating and passing your own custom events to Klaviyo using our Track API from the resources below:
I hope this helps!
David
So to summarize, the process for sending an email to a specific user with a dynamic string from a platform without a built-in Klaviyo integration would be:
- Manually send a track API event to Klaviyo
- Set up a Klaviyo flow with a trigger pointing to the event from step 1 (only possible after step 1 has been triggered)
- Include a wild-card in the email template
- Set up a trigger on our 3rd-party integration which sends the same track API event as in step #1 with the dynamic string and the requested user as a payload
- Klaviyo’s flow triggers, populates the template with the dynamic string and sends an email to the requested user
Have I understood the process correctly?
Hey @Lasse,
Yup! The process you’ve outlined is commonly how most people trigger flows and send emails based on custom events.
David
I see. Thank you very much!
I’ll try and make it work. And if it doesn’t, we’ll just have to also integrate with a transactional email service.
@David To
I was able to follow your outline (even though its linked to the deprecated endpoints), but I also happen to have been working with klaviyo in some capacity since before V1 of the API was called V1.
I think what @Lasse and I were looking for is something similar to the very easy and intuitive Render and Send Template Endpoint where you could very simply send a transactional email without having to incorporate so much seemingly unnecessary functionality to achieve the same result with the current versioned endpoints.
Granted, it does seem possible to replicate this (to a degree) with the steps you have provided except for one aspect which is reading the properties of the event inside the template.
Can you provide an example of how you read the Event Properties with custom template tags (django format) inside of a template?
Solved: Rendering Event Properties inside Email Template
With the help of this thread….
Example:
Step 1: Add Event Properties to Profile via the Create Event Endpoint
{
"data": {
"type": "event",
"attributes": {
"properties": {
"report_date": "2024-05-20",
"orders": d
{
"order_num": "63709",
"customer_name": "Customer A",
"sales_rep": "Rep A",
"order_total": "9,600.00",
"order_qty": "12",
"shipping_amount": "0.00"
},
{
"order_num": "63714",
"customer_name": "Customer B",
"sales_rep": "Rep A",
"order_total": "8,820.00",
"order_qty": "12",
"shipping_amount": "0.00"
},
{
"order_num": "63715",
"customer_name": "Customer C",
"sales_rep": "Rep B",
"order_total": "4,973.23",
"order_qty": "55",
"shipping_amount": "28.02"
}
]
},
"time": "2024-08-13T00:00:00",
"value": 0,
"metric": {
"data": {
"type": "metric",
"attributes": {
"name": "Daily Sales"
}
}
},
"profile": {
"data": {
"type": "profile",
"id": "JHEVC3"
}
}
},
"time": "2024-08-13T00:00:00",
"unique_id": "2408131011"
}
}
Step 2: Create Custom Flow w/ Trigger Metric = “Daily Sales”
Step 3: Select Email Message (use existing or create new template) and read Event Properties Inside Template
Using Django to Render Values inside of the Event Properties Object
Display “report_date” property:
<p>{{ event.report_date }}</p>
=>
“2024-05-20”
Iterate over the “orders” array:
<ul>
{% for order in event.orders %}
{% if order.sales_rep == "Rep A" %}
<li>{{ order.order_num }}</li>
<li>{{ order.customer_name }}</li>
{% endif %}
{% endfor %}
</ul>
=>
- 63709
- Customer A
- 63714
- Customer B