I am triggering an event "custom_checkout_started" in klaviyo when any user tries to purchase an item in my website. The event contains a property cart_id which is id of cart being processed. Also in the event i pass profile property "cart_ids" which is array of cart id which the user has discarded. If user completes the payment, the user profile will be updated in klaviyo where the cart id will be removed from cart_ids array. And in the flow i want to add a condition in filter to send the email only if payment is not completed(i.e if the cart_id in event is present in cart_ids property of profile). How do i check that condition? just came to know that we cannot the use the event property dynamically. ex. event.properties.cart_id or something like that. is in cart_ids
alternately i tried another approach, i created a list and whenever user starts checkout i trigger profile create api and subscription api which adds the user to the created list. i passed property “payment_status” as pending. i pass cart_url as another property to access discarded cart from email template.
i created a flow which gets triggered when user gets added to the above list and after certain multiple time delay, before sending email i checked profile property “payment_status” if its pending than sent the reminder email else remove the user from the list and so on. this continues for sending 2 further emails after certain delay.
when user completes the payment i update user profile property “payment_status” to complete so no further emails are sent.
but there may be a scenario. suppose i discard a cart, than a flow will start for me.. and after getting first email reminder i discard another cart , so it will again hit profile create/update api and subscription api. since i am already in list the flow won’t be triggered but the cart_link will be updated. hence the remaining two emails from flow one will have updated cart_link.. and no new flow will be created for this discarded cart.
myquestion
whenever another cart or mutiple carts are discarded by the same user when flow1 is in progress , i want to stop the currently running flow and start a new flow. how do i achieve it
or
using event flow how do i compare the cart_id with cart_ids so that i could prevent sending emails.