# Back in stock with exclusive discount for loyal customers ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20(62)_EWZjIB9z.jpg) Not sure where to use this template? Check out [Get started with workflow templates library](https://docs.foxecom.com/xflow-app/workflows/get-started-with-workflow-templates-library) ## About this template When a product is **back in stock**, check if the interested customer is a **loyal one (has multiple orders)** and send them an **exclusive discount code** along with the notification. ## Step-by-step guide to set up this template ### Trigger – Product restock The workflow starts when a product is restocked and becomes available again. πŸ“ Learn more about triggers: [Understanding workflow triggers](https://docs.foxecom.com/xflow-app/workflows/understanding-workflow-triggers) ![image](https://docs-assets.foxecom.app/xflow-app/image_ijV5mxlj.png) ### Condition – Customer criterias: Order count Set the condition to: **Order count β†’ Greater than β†’ a number.** This checks whether the customer has placed more than a specific number of orders. Tips: Set a **clear order count** to clearly define who qualifies as a loyal customer and avoid unexpected results. πŸ“ Learn more about actions: [Workflow condition: Customer criteria](https://docs.foxecom.com/xflow-app/workflows/understanding-workflow-conditions/workflow-condition-customer-criteria) ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20(9)_jeKxSNew.jpg) ### Action – Create discount code Create a unique discount code for the customer when the condition is met. πŸ“ Learn more about actions: [Understanding workflow actions](https://docs.foxecom.com/xflow-app/workflows/understanding-workflow-actions) ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20(10)_poktOKTc.jpg) ### Action – Send email Send a **Back in Stock notification email** that includes the newly created discount code. 1. Enter the **email subject**. 2. Select the **email template** that you have prepared in advance. If you don’t have an **email template** yet, check out [Create an email template](https://docs.foxecom.com/xflow-app/email-templates/create-an-email-template) Read more about the **variables** you can use in email: [Available variables in email templates](https://docs.foxecom.com/xflow-app/email-templates/understanding-personalization-variables-in-email-templates/available-variables-in-email-templates) ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20(11)_LMxHjeck.jpg) That way, you will send a **back-in-stock notification with an exclusive discount** to **loyal customers**, helping you reward repeat buyers and increase conversion when products are restocked. **🌟 Pro Tip:** * Set a clear order count to define which customers qualify as loyal. * Use exclusive, single-use discount codes to avoid misuse. * Reuse the discount logic in other loyalty or VIP workflows. ## Common use cases The **Back in stock with exclusive discount for loyal customers** workflow template is commonly used when: * You want to reward customers who have placed multiple orders. * You want to increase conversions on back in stock notifications. * You want to give loyal customers early access to back in stock notifications.