• App Junction
  • Posts
  • Quick Win: Optimize Your Shopify Recovery Emails Today

Quick Win: Optimize Your Shopify Recovery Emails Today

Save sales and customer trust with these template tweaks

In partnership with

Picture this: A customer returns to complete their purchase, excited to buy that product they left in their cart... only to find it's out of stock. Frustrating, right?

In today's Appjunction newsletter, I'm sharing a crucial guide that will help you avoid this common pitfall and keep your customers happy. You'll learn how to automatically exclude out-of-stock items from your abandoned cart and browse abandonment emails in Shopify, ensuring every recovery email you send is actionable and relevant.

Note: Key Considerations

Before you proceed, keep these points in mind:

Klaviyo’s Functionality for Out-of-Stock Items

  • Klaviyo will only mark items as "unpublished" if customers cannot purchase them when they are out-of-stock.

  • For products with multiple variations, all variations must be out-of-stock for Klaviyo to consider the entire product as unavailable.

The Abandoned Cart Flow

Klaviyo's default abandoned cart email templates include a dynamic table that populates each email with specific items the recipient left behind in their cart. To ensure your emails accurately reflect current stock, follow these steps to adjust the templates so they automatically cancel if any item is out-of-stock.

  1. Open Your Template: In Klaviyo, open the abandoned cart flow email template you want to edit.

  2. Adjusting Dynamic Content:

  • Click on the dynamic table within the template.

  • Under Content, ensure Column 1 is selected. If Column 1 is set to Image, toggle it to Text.

  • Under Cell Content, click the Source code icon.

  1. Inserting Code Snippet: Copy and paste the following snippet into the source code text box.

{% catalog item.product_id unpublished="cancel" %} 
<a href="{{ event.extra.responsive_checkout_url }}"> 
<img alt="" src="{{ catalog_item.featured_image.thumbnail.src }}" style="width: 200px;" width="200px" /></a> 
{% endcatalog %}
  1. Once you've finished, click Done in the upper left.

  2. Save your template.

This will ensure that:

  • Before any email in your flow is scheduled to send, Klaviyo will check each item that will dynamically populate in the email.

  • If any item is "unpublished" in your catalog at the time of checking, the entire email will be skipped.

To monitor skipped emails, navigate to Analytics > Recipient Activity > Other. Look for the category labeled "Skipped: Catalog Item Unavailable" where you can see all emails that were canceled because an item featured in the email was out-of-stock or unavailable (if the item is no longer in your catalog).

Note: If any item in a cart is out of stock, it is not possible to remove only that item and send the rest of the email as scheduled. The entire email will be canceled in such cases.

Double Your Referral Revenue in One Chat

I’m Luke, a referral marketing nerd who’s helped brands boost referrals to 10% of revenue (most only get 2%). Let’s chat for 15 minutes, and I’ll show you how to unlock hidden customer value.

I only work with 5 brands per month so be quick.

Responsive Checkout Page in Shopify

If the "Return to Cart" button in your abandoned cart flow emails isn't linking to the correct page, you may need to update the link URL.

  1. Open Your Template:

    • In Klaviyo, open the abandoned cart flow email template you want to edit.

  2. Editing the "Return to Cart" Button:

    • Click on the "Return to Cart" button to edit the link URL.

    • Change the Link URL from:

{{ event.extra.checkout_url }}

to the following:

{{ event.extra.responsive_checkout_url }}

By making this change, the "Return to Cart" button will link to the responsive checkout page, ensuring a smoother and more accurate user experience.

The Browse Abandonment Flow

Klaviyo's default browse abandonment email templates feature a dynamic table block that populates each email with the specific item a recipient browsed on your website. To ensure these emails are accurate, follow these steps to adjust the templates so they automatically cancel if the item is out-of-stock.

  1. Open Your Template:

    • In Klaviyo, open the browse abandonment flow email template you wish to edit.

  2. Adjusting Dynamic Content:

    • Click on the dynamic table within the template.

    • Under Content, ensure Column 1 is selected. If Column 1 is set to Image, toggle it to Text.

    • Under Cell Content, click the Source code icon.

  3. Inserting Code Snippet: Copy and paste the following snippet into the source code text box.

    {% catalog event.ProductID unpublished="cancel" %} <a href="{{ catalog_item.url }}"><img src="{{ catalog_item.featured_image.full.src }}" style="width: 200px;" width="200px" /></a> {% endcatalog %}
  1. Once you've finished, click Done in the upper left.

  2. Save your template.

This will ensure that:

Before sending an email in your flow, Klaviyo will check the item that will be dynamically added to each email. If the item is "unpublished" in your catalog at the time of the check, the email will be skipped.

To see which emails were skipped, go to Analytics > Recipient Activity > Other. There, you'll find a category labeled "Skipped: Catalog Item Unavailable." This section shows all the emails that were canceled because an item featured in the email was out-of-stock or no longer in your catalog.

How to test your out-of-stock feature

You can test this feature by:

  1. First, update your email templates as described earlier.

  2. Next, go to your site and either view an item or start a checkout with one item in your cart.

  3. Check your account’s Metric’s tab under Analytics until the tracked event appears.

  4. Temporarily mark that single item as out-of-stock in your store’s backend.

  5. Find the flow triggered by the action you took (either Viewed Product or Started Checkout) and locate your adjusted email templates.

  6. Click to preview one of these emails. Ensure the "choose a recent event to preview with" window shows your recent event.

  7. When you preview the email, you should see that the item’s image is missing, and instead, you’ll see a message saying: "Item (Number) is not published and unavailable."

Streamline your Shopify store's operations by updating email templates to cancel if items are out-of-stock. This approach enhances the reliability of your marketing efforts, ensuring customers receive notifications for available products only, thereby enhancing satisfaction and engagement.

I hope you found this guide helpful in optimizing your recovery emails. Remember, every small improvement in your customer's shopping experience can make a big difference in building trust and driving sales.

Until next time.

P.S. If you found this useful, forward it to a fellow Shopify store owner who might benefit from it too!

💬 Did you learn something new from today's newsletter?

Cast your vote and let us know how we're doing! Your feedback keeps us on our toes (and out of our pajamas)! 🎉💌

Login or Subscribe to participate in polls.