Hi everyone,
I’m trying to set up an automation (which I thought would be straightforward) to achieve the following:
Whenever a customer purchases a specific product, they should automatically receive an email with a unique discount code that can only be used once.
The idea is that this process should repeat every time the product is purchased (even by the same customer), and each code needs to be unique.
I’m currently using Shopify Flow and have generated a batch of unique codes using the Bulk Discount Code Bot app, but I can’t seem to find a way to fully automate the process—such as assigning a unique code dynamically and sending it via email.
Has anyone successfully set this up? Are there apps or workflows that can handle this without manual intervention?
Thanks so much for your insights and help!
Best to you all 
1 Like
Hello there @raganello I suggest you have a look at this article here https://docs.couponcarrier.io/article/90-how-to-deliver-a-unique-code-when-someone-purchases-a-product-on-shopify and it should help you in generating the automated discount codes you’re seeking out.
1 Like
Hi @raganello
if your using a service/app to send customer emails then in flow…
you probably just need two metafields setup:
- a metafield/metaobject that tracks the number of orders/codes-sent
- a metafield/metaobject that has the list of codes (as a list,array,or json) which uses each code based on #1’s value(s)
If your currently not able to send emails to customers an app is needed to bridge that gap
possibly either shopify-email , or an use automation app like mechainic to make something bespoke e.g. https://tasks.mechanic.dev/?q=send%20discount%20code & https://tasks.mechanic.dev/?q=email%20customer
If you need this process setup then contact me for services.
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
1 Like
Hi everyone,
Thank you so much for your suggestions—I really appreciate them!
In the meantime, I came up with a slightly different approach. By leveraging flows, tags, and Shopify’s email system, I believe I can set it up so the discount is applied automatically, without the need for a discount code. This way, when a user makes a purchase, the discount will automatically apply to their next purchase.
It seems much easier to implement this way.
Hi Raganello, nice job! This is a very wise approach. You’ll also be able to have only one discount setup, which is way easier to manage than having many discount codes auto-generated.
Here’s a question for you: How are you going to ensure the discount only applies to the next purchase? Automatic discounts don’t have the “Once per customer” setting that discount codes do. You might not want the customer to get a discount on every following purchase after buying the trigger item.
If you’re not already doing this, I recommend automatically removing the tag from a customer’s account once they have used the discount. I have written a tutorial (with video) about this in the past. You can do this with Shopify Flow (screenshot attached):
In short, you’ll want to hook into when an order is paid, then check the title of every discount applied to the order. If the title matches your discount, remove the tag. This setup will help prevent potential abuse of your offer.
Hope this helps,
Tobe Osakwe
Founder, Regios Technologies, Inc.
2 Likes
Hi there!
That is exactly what I was aiming to do, so thank you so much for your reply. I’m going to run some tests soon and will publish my solution to share it with anyone else who might be looking for it.
Thanks again!
You’re welcome! This is a common question we get from users of Regios Discounts (4.8 stars, 79 reviews, Built for Shopify), so common, that it made sense for me to create a dedicated tutorial. So, I figured it could save you some time getting your offer set up, even if you’re not using our app.
If you are ever on the lookout for a discount app, however, I’m here to help.
Best,
Tobe
1 Like
try make.com for the automation. made a video on how to achieve. https://www.youtube.com/watch?v=FVUCk1O40h4
Hi @Raganello,
Great question. You want each purchase of a specific product to trigger an email with a unique single use discount code automatically. Shopify Flow can detect the purchase but cannot assign individual codes dynamically on its own.
Here is a straightforward setup:
Generate a pool of codes
- Use the Bulk Discount Code Bot app to create a set of one time use codes
- Limit each code to one use per customer in the settings
Use an email platform with dynamic fields
- Choose a tool like Klaviyo or Omnisend that lets you assign custom properties
- In your flow, when the specific product is purchased, pull one unused code from your pool into the email using a dynamic tag
Track and refresh codes
- The platform will record which customer used which code
- For repeat purchases, it can select a new unused code and send it automatically
Shopify Email does not yet support this level of dynamic code injection, so pairing Flow with a more advanced email platform is the usual approach.
Looking for an Easier Way to Automate This Process?
Retentionly – AI Email Marketing is beginner friendly with AI integration and handles unique code emails without extra tools. You only pay for the emails you send, not for your entire list, and the Retentionly team sets up your automations for free so you can focus on growing your store.
Need a hand? Just reach out via our live chat, we’re happy to help!
Cheers,
Retentionly Team
If this helped, feel free to like or mark it as solved so others can find it too.