What's your biggest current challenge? Have your say in Community Polls along the right column.

How to create a segment for a promotional code with an expire date in 3 days after sent email?

How to create a segment for a promotional code with an expire date in 3 days after sent email?

PrismMoonKat
Tourist
3 0 1

Hello all, 

 

Been trying to find a way to do what i said above. 
I come with this 

 

number_of_orders = 0
AND abandoned_checkout_date >= -30d
AND storefront.product_viewed(since: -30d) = true
AND (current_date <= email_sent_date + 3d)


is this possible? I'm trying to find a way with a static code, but setting it expire date after customer receives a email with the said code. 


Replies 2 (2)

rajimulislamjoy
Shopify Partner
393 40 70

Yes, you can achieve this by implementing logic to check the conditions in your code. Here's a short example in pseudocode

 

 

if number_of_orders == 0 and
abandoned_checkout_date >= current_date - 30 days and
storefront.product_viewed(since: current_date - 30 days) and
current_date <= email_sent_date + 3 days:
# Send discount code or perform the desired action

Please don't forget to Like & Mark Solution to the post that helped you. Thanks!
If you'd like to support me, you can Buy Me a Coffee
Need a Shopify Designer or Dropshipping Expert ?
Hire us at WhatsApp! For Shopify Design | Shopify Customize | Dropshipping
PrismMoonKat
Tourist
3 0 1

Thank you! Sorry for the late reply, i will test this out and will update you on this matter. once again thank 😄