Skip to main content

Hello community! I am trying to come up with a way to abort sending an email for a product if the product is out of stock. I know there is a built in way with klaviyo ‘unpublished=”cancel”’ but that is blocked behind logic that doesn’t work for our client. 

 

I have already created a dynamic collection for out of stock products, have a conditional that pops when the product for the email (based on a viewed product event) is out of stock, but don’t actually know the code to abort an email from within the template. 

 

Is there a way to cancel out of the email, programmatically through template? Something like {% exit %} or {% break %} or {% skip_email %} that would have the same end result as the unpublished=”cancel”?

 

I am trying to find a list of available email template tags that I can use, but I think there may not be a comprehensive list. I have found several documents that reference a few, like unsubscribe and web_view, but the full list remains elusive.

Hey @pcarson 

Welcome to the community!

It is not possible to add a variable into a template to cancel the email from sending. As for a comprehensive list of variables, we do have the help center reference on message personalization that you found, however each integration uses slightly different variables for most personalizations, which is why there isn’t just one comprehensive list of all possible variables.


Reply