Skip to main content
Solved

How to Automatically Include the Same Unique Discount Code in Welcome Email?

  • July 21, 2025
  • 3 replies
  • 59 views

Forum|alt.badge.img

Hi everyone,

We’re using unique discount codes that are automatically applied at checkout when someone signs up through our form.

However, if the customer leaves the page, the code disappears — so we want to automatically include that same unique code in the welcome email they receive, so they can access it later.

Is there a way to automatically pull the same unique code shown at checkout into the email?

Would really appreciate any advice or guidance from anyone who’s figured this out!

Thanks so much!

Best answer by bluesnapper

Welcome to the community ​@LuxeHomesDirect 

I'll assume you're on Shopify; using a Klaviyo form; generating the unique codes in Klaviyo.

When a unique discount code is assigned by Klaviyo to a profile - whether that's via a form or within a campaign or flow message - that unique discount code is tied to only that specific profile.

As an example, say your unique coupon name in Klaviyo is called WELCOME25 and I sign up on your form. I get assigned my unique discount code of  WELCOME_XGHTSAK

If you then send me a welcome flow email that contains the placeholder snippet: 

{% coupon_code 'WELCOME25' %} 

I will  receive my unique code WELCOME_XGHTSAK where the placeholder is. That is true wherever you include {% coupon_code 'WELCOME25' %}, I will always receive WELCOME_XGHTSAK.

Hope that helps but, if not, let me know

Regards

Andy
 

3 replies

bluesnapper
Partner
Forum|alt.badge.img+45
  • Champion & Partner
  • 784 replies
  • Answer
  • July 22, 2025

Welcome to the community ​@LuxeHomesDirect 

I'll assume you're on Shopify; using a Klaviyo form; generating the unique codes in Klaviyo.

When a unique discount code is assigned by Klaviyo to a profile - whether that's via a form or within a campaign or flow message - that unique discount code is tied to only that specific profile.

As an example, say your unique coupon name in Klaviyo is called WELCOME25 and I sign up on your form. I get assigned my unique discount code of  WELCOME_XGHTSAK

If you then send me a welcome flow email that contains the placeholder snippet: 

{% coupon_code 'WELCOME25' %} 

I will  receive my unique code WELCOME_XGHTSAK where the placeholder is. That is true wherever you include {% coupon_code 'WELCOME25' %}, I will always receive WELCOME_XGHTSAK.

Hope that helps but, if not, let me know

Regards

Andy
 


Forum|alt.badge.img
  • Author
  • Contributor I
  • 1 reply
  • July 22, 2025

It worked! Thank you so much for your help, Andy!


bluesnapper
Partner
Forum|alt.badge.img+45
  • Champion & Partner
  • 784 replies
  • July 23, 2025

No problem ​@LuxeHomesDirect Happy to help.

Regards

Andy