> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://stoqapp.crisp.help/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to send back in stock alerts using Shopify Flow

STOQ integrates with Shopify Flow so you can send back-in-stock alerts through Shopify Flow instead of using STOQ's built-in email system. When a product is restocked and a customer is notified, STOQ fires a trigger inside Shopify Flow. You then connect that trigger to any action — like sending a marketing email — using Shopify's visual workflow builder. This gives you full control over your restock alert emails, including design, branding, and delivery through your preferred marketing tool.

### What Is Shopify Flow?

Shopify Flow is a free automation tool built into Shopify that lets you create workflows without writing any code. Each workflow has three parts:

* **Trigger** — the event that starts the workflow (e.g., a customer is notified for a back-in-stock alert)
* **Condition** — an optional check that filters which events continue (e.g., the customer has a valid email address)
* **Action** — what happens when conditions are met (e.g., send a marketing email)

STOQ provides its own triggers that appear inside Shopify Flow. When you select **Shopify Flow** as your email platform in STOQ, the app stops sending emails itself and instead fires a Flow trigger for every notification. You build the rest of the workflow in Shopify Flow.

### How to Set Up Back-in-Stock Alerts Through Shopify Flow

Setting up Shopify Flow for your back-in-stock alerts requires two steps: choosing Flow as your email platform in STOQ, and creating a workflow in Shopify Flow.

##### Step 1 — Select Shopify Flow as Your Email Platform

1. In your Shopify admin, open **STOQ** and go to **Back in stock alerts** → **Settings** → **Notifications**.
2. Click **Customize email** to open the email template editor.
3. Under **Email platform**, select **Shopify Flow**.
4. Click **Save**.

![](https://storage.crisp.chat/users/helpdesk/website/-/f/6/9/b/f69b1402a211d800/image_9vgq09.png)
![](https://storage.crisp.chat/users/helpdesk/website/-/f/6/9/b/f69b1402a211d800/image_yu6d73.png)
![](https://storage.crisp.chat/users/helpdesk/website/-/f/6/9/b/f69b1402a211d800/image_2ixlkc.png)
|| **Note:** When you select Shopify Flow as your email platform, STOQ automatically enables the **Customer notified for email back in stock alert** trigger in your integrations settings. STOQ will no longer send restock emails itself — all email delivery is handled through your Shopify Flow workflow.

![](https://storage.crisp.chat/users/helpdesk/website/-/f/6/9/b/f69b1402a211d800/image_104aj64.png)

##### Step 2 - Download and Import into Shopify flow (Recommended)

To save you from building the workflow from scratch, STOQ provides a prebuilt Shopify Flow file you can import directly into your store. It already includes the STOQ trigger, the customer-data lookup, the email condition, and the loop — set up for **Shopify Email**. After importing, you only need to design the email and turn the workflow on.

1. **Download the workflow file.** Open the link below and download the `.flow` file to your computer: [Download the STOQ back-in-stock Shopify Flow](https://drive.google.com/file/d/1loP8aihyl5WMhu7Vdf8QWAcebT6ntdjx/view?usp=sharing) (In Google Drive, click the **Download** icon in the top-right corner.)
2. In your Shopify admin, go to **Settings** → **Shopify Flow** (or search for "Flow" in the admin search bar).
3. On the Shopify Flow home page, click the **Import** button (or the **⋯ / more actions** menu, then **Import**).
4. Select the `.flow` file you just downloaded and upload it.
5. Shopify opens the imported workflow in the editor so you can review each step.
6. Open the **Send marketing email** action and design your email template (see Step 4). You can also adjust the trigger, condition, or loop if needed.
7. When you're ready, click **Turn on workflow** to activate it.

![](https://storage.crisp.chat/users/helpdesk/website/-/f/6/9/b/f69b1402a211d800/image_k7xktq.png)
![](https://storage.crisp.chat/users/helpdesk/website/-/f/6/9/b/f69b1402a211d800/image_r4ukku.png)
|| **Note:** Importing a workflow brings in the structure (trigger, conditions, and actions), but Shopify requires you to **select or create your own email template** inside the **Send marketing email** action before the workflow can go live. The imported file does not include a finished email design.

**Prefer to build it yourself?** Follow Step 3 below instead of importing.

##### Step 3 — Build the Workflow Manually (Alternative to Importing)

When you create a workflow in Shopify Flow that uses a STOQ trigger and turn it on, Shopify automatically notifies STOQ through a lifecycle callback. STOQ then enables the trigger and turns on the Flow triggers master switch in your integrations settings — no manual setup needed on the STOQ side.

Follow these steps to create your workflow:

1. In your Shopify admin, go to **Settings** → **Shopify Flow** (or search for "Flow" in the admin search bar).
2. Click **Create workflow**.
3. Click **Select a trigger** and search for **STOQ**.
4. Select **Customer notified for back in stock alert**.
5. Add a **Get customer data** action to retrieve the customer's details using an advanced query.
6. Add a **Condition** to check that the customer's default email address is not empty and exists.
7. If the condition is **True**, add a **For each loop** to iterate over the customer data results.
8. Inside the loop, add a **Send marketing email** action.
9. Configure the email action:
* Set **Customer** to the customer reference from the loop (e.g., `{{getCustomerData.Foreachitem.id}}`).
* Choose or create an **Email template** with your branding and content.
10. Click **Turn on workflow** to activate it.

| **Tip:** You can click **Test your workflow** in the top-right corner of the Flow editor to simulate a trigger and confirm everything runs correctly before going live.

Once you turn on the workflow, STOQ automatically detects that you are using its trigger. You can verify this by going to Back in stock alerts → Settings → Integrations → Shopify Flow — the Flow triggers toggle and the relevant trigger checkbox should now be enabled.

##### Step 4 — Design Your Email Template (Shopify Email)

1. In the **Send marketing email** action, click **Edit email** to open the Shopify Email template editor.
2. Customize the template with your store branding, product images, and messaging.
3. Click **Save** when you are done.

The email template is managed entirely in Shopify — not in STOQ. This means you can use Shopify Email's full design tools, including your store logo, custom colors, product blocks, and call-to-action buttons.

||| **Important — product variables cannot be inserted dynamically.** Shopify Email does not support injecting product data (title, image, price, etc.) from the Flow trigger into the email template. You must select a specific product inside the Shopify Email editor and hardcode it into the template. This means every customer who receives the email sees the same product — regardless of which variant was actually restocked. See the section below for details.

### Using Your Own Marketing Platform's "Send Email" Action

The steps above use Shopify Email and its Send marketing email action. If you already use another marketing platform — such as Klaviyo, Omnisend, or another email tool that offers a Shopify Flow extension — you can use that platform's own "send email" action inside your Flow workflow instead of the Shopify Email action.

To do this, build the workflow the same way (STOQ trigger → get customer data → condition → loop), but in the final step add your marketing platform's send-email action rather than Send marketing email:

* Inside the For each loop, click Add action.
* Search for your marketing platform (e.g., "Klaviyo").
* Select its send-email action and configure it with the customer and any data fields it supports.
* Turn on the workflow.

|| Why this matters: Some marketing platforms' Flow actions support dynamic data, which means they may be able to populate each email with the correct restocked product — something Shopify Email cannot do (see below). Availability and supported fields depend on your platform, so check what your marketing app's Flow action offers. If you want dynamic product data without setting up a Flow, connecting STOQ directly to Klaviyo or using STOQ's built-in emails is usually simpler (see When to Send Alerts from STOQ or Klaviyo Instead).

### Why Product Data Cannot Be Passed into the Email Template

This is one of the most important things to understand when using Shopify Flow for back-in-stock alerts. Although STOQ sends product-level data in the trigger (Product ID, Variant ID, Variant name, checkout link, and product page link), Shopify Email templates do not accept dynamic product variables from Flow.

When you design your email in Shopify Email's editor, you pick a specific product from your catalog and that product is hardcoded into the template. There is no way to swap the product dynamically based on which item was restocked. As a result:

* **Every back-in-stock email shows the same hardcoded product** — not the product the customer actually signed up for.
* **The Buy now / Shop now button links to the hardcoded product** — not the restocked variant.
* **Product images, titles, and prices are static** — they do not change per notification.

This happens because the **Send marketing email** action in Shopify Flow is designed for general marketing campaigns, not transactional or event-driven emails like back-in-stock alerts. It was built to send the same branded content to a list of customers — not to personalize each email with different product data.

### Variables Available in Shopify Email Templates

Shopify Email templates only support the following variable categories. Notice that **no product variables** are included — this is the core reason product data from STOQ's trigger cannot appear in the email.

**Customer variables**

| Variable | Description |
| ---- |
| `customer.name` | Full name (`customer.first_name` / `customer.last_name` also available) |
| `customer.email` | Email address |
| `customer.phone` | Phone number |
| `customer.id` | Shopify customer ID |
| `customer.default_address` | Default address on file |
| `customer.addresses` / `customer.addresses_count` | All addresses and total count |
| `customer.orders` / `customer.orders_count` | Order history and total count |
| `customer.last_order` | Most recent order |
| `customer.total_spent` | Lifetime spend |
| `customer.tags` | Customer tags |
| `customer.accepts_marketing` | Marketing consent status |
| `customer.has_account` | Whether the customer has an account |
| `customer.tax_exempt` | Tax exemption status |
| `customer.b2b?` | Whether the customer is a B2B buyer |
| `customer.payment_methods` | Saved payment methods |
| `customer.store_credit_account.balance` | Store credit balance |

**Shop variables**

| Variable | Description |
| ---- |
| `shop.name` | Store name |
| `shop.domain` | Primary domain |
| `shop.url` | Full store URL |
| `shop.shopify_domain` | `.``myshopify.com` domain |
| `shop.address` | Store address (includes `address1`, `address2`, `city`, `country`, `phone`, `province`, `zip`) |

**Email variables**

| Variable | Description |
| ---- |
| `email.subject` | Email subject line |
| `email.preview_text` | Preview text shown in inbox |

|| **What's missing:** There are no `product.*` or `variant.*` variables. This means the restocked product's title, image, price, variant name, checkout link, and product page link from STOQ's trigger data cannot be inserted into the email body. The only way to show a product in the email is to manually select one in Shopify Email's editor, which hardcodes it for all recipients.

|| **In short:** The Shopify Flow + Shopify Email combination works well if you restock a single product and want to notify its waitlist with a nicely branded email. It does not scale to multiple products restocking at different times, because you would need to manually update the hardcoded product in your email template each time.

### When to Send Alerts from STOQ or Klaviyo Instead

If you sell multiple products that go in and out of stock, the Shopify Flow approach has significant limitations. Here are the recommended alternatives.

##### Send Directly from STOQ

STOQ's built-in email system is purpose-built for back-in-stock alerts. It automatically fills in each email with the correct product title, image, price, variant name, purchase link, and unsubscribe link — no hardcoding needed. Every customer receives an email that matches the exact product and variant they signed up for.

To switch back to STOQ's built-in emails:

1. Go to **Back in stock alerts** → **Settings** → **Notifications**.
2. Click **Customize email**.
3. Under **Email platform**, select **STOQ**.
4. Click **Save**.

STOQ also supports reminder emails, per-product templates, and market-aware pricing — none of which are available through Shopify Flow.

##### Connect Klaviyo or Another Third-Party App

If you prefer an external marketing platform with advanced segmentation, A/B testing, or multi-channel flows, connect **Klaviyo**, **Omnisend**, or another supported integration. These platforms receive product-level data from STOQ and can dynamically populate each email with the correct product details.

To connect Klaviyo:

1. Go to **Back in stock alerts** → **Settings** → **Integrations**.
2. Open the **Klaviyo** integration.
3. Enter your Klaviyo API key and enable the sync.
4. Set **Klaviyo** as your email platform under **Notifications** → **Customize email** → **Email platform**.

| **Tip:** If you need full control over email design and also need dynamic product data in every email, STOQ's built-in system or Klaviyo are the best choices. Use Shopify Flow only if you are comfortable with a single hardcoded product in your email template.

### Available Trigger Data

When the **Customer notified for back in stock alert** trigger fires, STOQ sends the following data to Shopify Flow. You can use these fields in conditions, actions, and email templates.

| Field | Description | Example |
| ---- |
| **Customer ID** | The customer's internal ID | `12345` |
| **Customer name** | Full name | `John Appleseed` |
| **Customer first name** | First name | `John` |
| **Customer last name** | Last name | `Appleseed` |
| **Customer email** | Email address used for the alert | `john@example.com` |
| **Customer locale** | Customer's language/locale | `en` |
| **Customer phone** | Phone number (if available) | `+1234567890` |
| **Product ID** | Shopify product ID | `7890123456` |
| **Variant ID** | Shopify variant ID | `4567890123` |
| **Variant name** | Name of the restocked variant | `Blue / Large` |
| **Market ID** | Shopify market ID | `1001` |
| **Notification type** | Channel type | `email` |
| **Checkout link** | Direct link to checkout with the product | URL |
| **Product page link** | Link to the product page | URL |
| **Unsubscribe link** | Link for the customer to unsubscribe | URL |

| **Tip:** Use the **Checkout link** in your email template's call-to-action button so customers can purchase the restocked item in one click.

### Alternative Trigger — Product Variant Restocked

STOQ also provides a **Product variant restocked** trigger for a different workflow approach. Instead of firing once per customer notification, this trigger fires once when a product variant comes back in stock.

| Field | Description |
| ---- |
| **Product ID** | Shopify product ID |
| **Variant ID** | Shopify variant ID |
| **Market IDs** | List of market IDs where the variant is restocked |

Use this trigger when you want to build your own notification logic entirely in Shopify Flow — for example, querying your customer list and sending bulk emails based on the restocked variant.

To enable it, go to **Back in stock alerts** → **Settings** → **Integrations** → **Shopify Flow** → **Triggers** tab and check **Product variant restocked**.

### Automatic Customer Sync with Shopify

When Shopify Flow is your back-in-stock email provider, STOQ automatically keeps your customers synced to Shopify — no manual setup required. Here is how it works.

* STOQ passes the Shopify customer into the Flow trigger. Your Flow workflows can act on the actual customer — add tags, build segments, trigger follow-ups, or include them in marketing automations like abandoned cart.
* Customer sync happens automatically in real time. Whenever a visitor signs up for a back-in-stock alert, STOQ syncs them to your Shopify Customers list before the Flow trigger fires. If the customer already exists (matched by email or phone), STOQ links to their existing profile without creating a duplicate.
* No extra setup needed. Previously, you had to manually turn on customer sync in STOQ's integration settings. STOQ now handles this for you whenever Shopify Flow is your email platform.
This means the Get customer data and Send marketing email actions in your Flow workflow always have a valid Shopify customer to work with.

| Tip: Because STOQ now passes the Shopify customer directly, your Flow workflows can go beyond just sending emails. Use conditions based on `customer.tags`, `customer.orders_count`, or `customer.total_spent` to build smarter automations — for example, only sending alerts to customers who have previously purchased, or tagging high-value customers for VIP notifications.

### Known Limitations

* **Reminder emails are not supported.** When you use Shopify Flow as your email platform, STOQ disables all reminder (follow-up) email templates. Only the first notification is sent via Flow.
* **Flow events are rate-limited.** For large waitlists, there may be a delay between when a product is restocked and when all trigger events are delivered to Shopify Flow.
* **Shopify Flow is not available for preorder alerts.** The Flow email platform option only applies to back-in-stock notifications, not preorder notifications.
* **Paid STOQ plan required.** Selecting Shopify Flow as your email platform and enabling Flow triggers requires a paid STOQ plan.
* **Online Store 2.0 theme required.** STOQ requires a Shopify Online Store 2.0 or newer theme for app embed functionality.
* **Marketing email consent required.** The **Send marketing email** action in Shopify Flow only sends to customers who have opted in to email marketing. Customers who have not subscribed to marketing will not receive the email.
* **Product variables cannot be passed into Shopify Email templates.** There is no way to dynamically insert product data (title, image, price, etc.) from the Flow trigger into the email. You must hardcode a specific product in the Shopify Email editor, which means every recipient sees the same product regardless of which item was restocked.
* **Not ideal for multiple restocking products.** Because the email template shows a single hardcoded product, this approach does not scale well if you regularly restock different products. Consider using STOQ's built-in emails or Klaviyo instead.

### Troubleshooting

| Symptom | Likely Cause | Fix |
| ---- |
| Customers are not receiving emails | Email platform is not set to Shopify Flow in STOQ | Go to **Back in stock alerts** → **Settings** → **Notifications** → **Customize email** and select **Shopify Flow** under Email platform |
| Trigger is not firing in Shopify Flow | The Flow trigger was not auto-enabled or the workflow is turned off | Verify your workflow is turned on in Shopify Flow. Then check **Back in stock alerts** → **Settings** → **Integrations** → **Shopify Flow** — the trigger should be enabled automatically. If not, enable it manually |
| Workflow runs but no email is sent | Customer does not exist in Shopify or has not opted in to email marketing | Make sure **Sync visitors with Shopify** is enabled in the Shopify integration so customers are created in Shopify. Also check the customer's marketing consent in Shopify admin |
| Emails are delayed for large waitlists | Flow events are rate-limited by Shopify | This is expected. Events are queued and delivered over time. No action needed — all customers will eventually receive the trigger |
| Workflow shows an error on the condition step | Email address condition is misconfigured | Verify the condition checks that the default email address **is not empty and exists** |
| Reminder emails stopped sending | Reminders are disabled when Flow is the email platform | Switch back to **STOQ** as the email platform if you need reminder emails |

### FAQs

**Q: Can I use Shopify Flow and STOQ's built-in emails at the same time?**
A: No. You choose one email platform at a time. When Shopify Flow is selected, STOQ does not send emails itself — it fires a trigger and relies on your Flow workflow to handle delivery.

**Q: Do I need to install Shopify Flow separately?**
A: No. Shopify Flow is built into Shopify and available on all Shopify plans. You can access it from your Shopify admin under Settings or by searching for "Flow."

**Q: Can I send SMS alerts through Shopify Flow?**
A: The "Customer notified for email back in stock alert" trigger is specific to email notifications. SMS alerts are managed separately in STOQ's notification settings and are not routed through Shopify Flow.

**Q: What happens if my Shopify Flow workflow is turned off?**
A: STOQ will still fire the trigger, but Shopify Flow will not process it. Customers will not receive any email until the workflow is turned back on.

**Q: Can I use a third-party email tool like Klaviyo or Mailchimp through Shopify Flow?**
A: Yes. Instead of the built-in Send marketing email action, you can connect a third-party marketing app's Flow extension to your workflow. Many email marketing tools provide Shopify Flow actions for sending emails.

**Q: Will switching to Shopify Flow affect my existing waitlists?**
A: No. Your waitlists remain intact. The only change is how the notification email is delivered. Instead of STOQ sending the email directly, STOQ fires a Flow trigger and your workflow handles the rest.

**Q: Why are reminder emails disabled when I use Shopify Flow?**
A: Shopify Flow handles only the initial notification trigger. STOQ's reminder email system is not compatible with Flow-based delivery, so reminder templates are automatically disabled when you switch to the Flow email platform.

**Q: Can I customize which data fields appear in my email template?**
A: Yes. All trigger data fields (customer name, product details, checkout link, etc.) are available in Shopify Flow. You can reference any of these fields when building your email template or configuring actions in your workflow.

**Q: Is Shopify Flow suitable if I restock many different products?**
A: Not really. Because the email template is locked to a single hardcoded product, you would need to manually update it every time a different product restocks. For stores with multiple products going in and out of stock, STOQ's built-in emails or a third-party platform like Klaviyo are better options since they dynamically populate each email with the correct product data.