All things Shopify and commerce
Hi @Aurimka ,
It sounds like you’re using Shopify’s Shopify Flow app to automate email campaigns, and you want to ensure that the same unique discount code from the first email is included in the discount reminder email. Since Shopify Flow doesn’t store previous discount codes natively, here’s a way to achieve this:
Solution: Store and Reuse the Discount Code
Store the Discount Code in Customer Metafields
Since each recipient gets a unique code, you can save it to a metafield on the customer profile:
Use a Shopify Flow action to add the discount code to the customer's metafields.
Example metafield: customer.metafields.custom.discount_code
Retrieve the Discount Code in the Reminder Email
When setting up the discount reminder email, retrieve the stored code using Liquid:
Your exclusive discount code: {{ customer.metafields.custom.discount_code }}
This ensures that each customer gets the exact same code in both emails.
Hope these steps will help you, let me know if you need any help.
Regards,
Dotsquares Ltd
Problem Solved? ✔ Accept and Like solution to help future merchants.
Thank you for your response. I've already done this, but I got to the point of updating the metafield and I don't know what exactly I need to specify in the Value field. Since the code is dynamic, should the Value field contain a variable or a static value of the code name?
To manage the customer text metafield, you have to create a program to write the dynamic code into the created metafield, and you can manage it from there. if you have any queries, feel free to ask us.
Dotsquares Ltd
Problem Solved? ✔ Accept and Like solution to help future merchants.
What should this program look like and where can I create it?
@Aurimka , wanted to check in here and see if you were able to work out a solution for this one? If not I think this can be done through flows (but there's a limit of upto 1000 customers in that)
But before I dive deeper - wanted to ask, what's the email platform you use to build your campaigns. You mentioned "app flow" so I'm assuming Klaviyo. But I wanted to be sure.
Thanks,
Founder
• Dollarlabs: Ultimate Discounts (5★) – If you can think of a discount, you can build it
• Dollarback: Cashback & Loyalty (5★) – Simple cashback. Powerful loyalty.
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025