Mastering Shopify Flow for Back-in-Stock Alerts: Native Emails vs. Custom Solutions

Hey everyone,

It's been a lively week in the Shopify community, and I wanted to dive into a super common, yet often tricky, topic that popped up recently: mastering those 'back in stock' notifications using Shopify Flow. We saw a great discussion kicked off by francesco_mi, who brought up a really insightful challenge that many of you might face when trying to move from custom solutions to Shopify's native tools.

The Back-in-Stock Workflow: Custom vs. Native Shopify Email

Francesco had a fantastic, robust system already in place for sending back-in-stock emails. His setup, which many of you might appreciate for its flexibility, involved:

  1. When a customer requests a notification, he adds a specific tag to their customer profile, identifying the product. This is done via Flow Webhooks – smart!
  2. The core trigger for sending the email is Product variant inventory quantity changed.
  3. He then retrieves customer information using Get customer data, based on that product-specific tag.
  4. Finally, the email goes out using a Send HTTP Request action, leveraging the SendGrid API. Crucially, he passes dynamic variables like product title and customer email this way.

As francesco_mi put it, "This solution works perfectly." And honestly, that's a testament to the power and flexibility you get when you go a bit more custom with Flow and external tools like SendGrid. You have absolute control over your data and how it's presented.

But here's where the plot thickens. Francesco, like many of us, was looking to streamline and potentially integrate more deeply with Shopify's native features. He noticed that Shopify Messaging / Shopify Email also suggested a "Back in stock alert" automation. So, he tried to replicate his success by creating a custom email template with code within Shopify's native email system, inserting the same dynamic variables he used with SendGrid.

The problem? The email sent, but those dynamic fields were completely empty. Sound familiar? It's a classic head-scratcher!

Why Your Dynamic Variables Might Be Empty in Native Shopify Emails

This is where the community chimed in with some excellent pointers. Jordan_Pimsical immediately suggested checking against the official Shopify template for any typos or misconfigurations :slight_smile:, even linking directly to it: https://admin.shopify.com/apps/flow/editor/templates/01952674-1f11-7ece-916a-568cf9626c09?search=back+in+stock&sort=best_match. Maximus3 also reinforced this, noting that "Messaging uses Flow as it’s engine" and that a "back in stock email template" likely already exists.

And they're absolutely right! Shopify Flow is indeed the engine behind many of Shopify's native automations, including those in Shopify Email and Messaging. The key insight here, and the likely reason francesco_mi's custom variables weren't populating, comes down to how data context is passed from Flow to Shopify's native email templates.

When you use the "Send email" action in Shopify Flow that integrates with Shopify Email templates, those templates expect specific Liquid objects to be available in their context. Think of it like a predefined set of ingredients. For a back-in-stock email, the template is usually looking for things like a customer object (with their email, name, etc.) and a product or variant object (with its title, image, URL, etc.).

Francesco's custom Flow, while brilliant for SendGrid, was likely retrieving customer data and identifying products in a way that didn't automatically map these details into the standard customer and product objects expected by Shopify's native email templates. When you use Send HTTP Request with SendGrid, you're explicitly defining a JSON payload with your variables, and SendGrid's template engine knows exactly what to do with them. Shopify's native email templates are a bit more opinionated about their input.

Making Native Shopify Back-in-Stock Emails Work for You

So, how do you bridge this gap? You have a couple of solid options, depending on your desired level of customization.

Option 1: Embrace the Official Shopify Flow Template

The simplest and often most robust solution is to start with, or at least analyze, the official Shopify Flow template for back-in-stock alerts. As Jordan_Pimsical suggested, you can find it directly in your Flow admin.

https://admin.shopify.com/apps/flow/editor/templates/01952674-1f11-7ece-916a-568cf9626c09?search=back+in+stock&sort=best_match

This template is designed to correctly pass the necessary customer and product (or variant) objects to the native Shopify Email template. It handles the data context automatically. If you're wondering "why is there a 'Back in stock alert' automation suggested inside Messaging?", this template is precisely why! It's Shopify's built-in way of doing it, ensuring all the right data is available for the email.

Steps to use the official template:
  1. Navigate to Shopify Flow in your admin.
  2. Go to Templates.
  3. Search for "Back in stock alert" or similar.
  4. Review the template. It typically uses the "Product variant inventory quantity changed" trigger and then has actions to identify customers who requested notifications for that product, followed by a "Send email" action that targets the native Shopify email system.
  5. Activate and customize the email content within your Shopify Email settings if needed.

This path ensures your email templates receive the expected Liquid objects, making your dynamic fields populate correctly.

Option 2: Adapt Your Custom Flow for Native Shopify Emails

If you absolutely need to stick to your custom tagging and webhook logic for identifying customers (which, again, is a perfectly valid and powerful approach!), you'll need to carefully examine how your custom Flow's "Send email" action is configured.

The trick is to ensure that when you use the "Send email" action (the one that uses Shopify's native email templates, not a custom HTTP request), you are explicitly telling Flow which customer object and which product or variant object to make available to the email template.

For example, after your "Get customer data" step, you'd want to ensure that the customer object you retrieved is passed directly to the "Send email" action. Similarly, the product or variant that triggered the Flow needs to be explicitly associated. You might need to use Flow's built-in variables or possibly an intermediate "Get data" action to ensure the product object is fully formed and available in the email context.

It's all about ensuring the "Send email" action receives a payload that matches what the native email templates expect. If the template is trying to access {{ customer.first_name }} but the Flow only passed customer_first_name_string, it won't know what to do with it.

Ultimately, francesco_mi's excellent question highlights a critical distinction: while Shopify Flow is incredibly flexible, when you integrate with native Shopify features like email templates, you're often working within a more structured data environment. Understanding the expected Liquid objects and how Flow maps its data to them is key to making those dynamic variables shine. Whether you go with the robust custom SendGrid route or leverage Shopify's native templates with a well-configured Flow, the goal is always the same: deliver timely, personalized messages to your customers!

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases