Skip to main content
Contributor I
July 21, 2025
Solved

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

  • July 21, 2025
  • 4 replies
  • 267 views

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
     

    4 replies

    bluesnapper
    Partner
    Champion & Partner
    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
     

    https://bluesnapper.com - Klaviyo Champion '24 & Partner
    Contributor I
    July 22, 2025

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

    bluesnapper
    Partner
    Champion & Partner
    July 23, 2025

    No problem ​@LuxeHomesDirect Happy to help.

    Regards

    Andy

    https://bluesnapper.com - Klaviyo Champion '24 & Partner
    Contributor I
    May 11, 2026

    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
     

    Hi!

    If I do this with the placeholder text in my welcome flow and someone joins through a different avenue/form - will the placeholder generate a unique coupon code for that person?

    Our flow is triggered by joining our master list, but different forms feed into it. 

    Thanks!