Show Gift Card Product variant name on gift card email

Topic summary

Goal: Include the selected gift card variant name (e.g., “Child Shoes £10”) in the Shopify gift card email on the Dawn theme.

Key issue: The Liquid object gift_card.product.selected_variant returns blank in the gift card notification email. Others confirm this is a known Shopify limitation, affecting variant data (including image).

Workaround 1 (recommended): Pass the variant title as a custom cart/line item property when adding to cart via JavaScript, then render it in the New gift card notification using gift_card.properties. This requires theme code edits (JS on product page + Liquid loop in the email template).

Workaround 2 (simpler, limited): If each variant has a unique price, map gift_card.initial_value (in minor units, e.g., £10 = 1000) to display the corresponding variant label.

Status/outcome: No native fix; suggestion to submit feedback to Shopify. One participant moved to an alternative (Stamped digital downloads) or briefly customized Shopify’s voucher email. Variant image display remains unresolved due to the same limitation.

Note: Provided JavaScript and Liquid code snippets are central to implementing the workarounds.

Summarized with AI on December 11. AI used: gpt-5.

Hi,

I would like my customers to be able to buy gift card products and the gift card they receive to include the variant name and the value.

For example…

Gift Card Product - Shoes

With Variants -

Child Shoes £10

Adult Shoes £20

Just now if a customer buys the child shoes version as a gift for someone, they receive a gift card that simply has the text £10. I would like it to say Child Shoes £10.

Is it possible to change the code somewhere to include the variant name?

Thanks

Hey @GilRZ , can you give the link to your store, and could you please mention the theme you are currently using?

Cheers,

Hi,

I haven’t made the products live yet, but I’m using the Dawn theme.

Thanks

Hi,

I also use the Dawn theme and can’t figure out how to display Variant title on email template or giftcard template.
some people seems to manage it with :

{{ gift_card.product.selected_variant.title }}

Hey @GilRZ , sorry for being late my notification ring doesn’t work.

Could you please send me some screenshots just to understand more what you want to implement?

Please share your store url as well.

Hi @GilRZ ,
Did you get any solution for this problem? It’s strange that when you use {{ gift_card.product }} it returns proper data but {{ gift_card.product.selected_variant }} returns blank or anything related to variant not returning any data.
Please let me know if you have found any solution, I want to display the image of the selected variant.

Hello,

No, I did not find a suitable answer and ended up going a totally different route using stamped digital downloads as in store vouchers. I did for a time, use the shopify voucher system and changed the voucher email to include variants .

Hey @GilRZ,

So this is actually a known limitation in Shopify. The gift_card.product.selected_variant object doesn’t work in the gift card notification email - it just returns blank. Multiple people have confirmed this in the community forums.

There are two workarounds that actually work:

Option 1: Line item properties (best solution)

You need to pass the variant title as a line item property when the customer adds the gift card to cart. Then you can access it in the email via gift_card.properties.

  1. On your gift card product page, add JavaScript that captures the variant title and passes it as a line item property:
document.querySelector('form[action="/cart/add"]').addEventListener('submit', function(e) {
  var variantTitle = document.querySelector('[name="id"] option:checked')?.text || 
                     document.querySelector('.selected-variant')?.textContent;
  
  var input = document.createElement('input');
  input.type = 'hidden';
  input.name = 'properties[Gift Card Type]';
  input.value = variantTitle;
  this.appendChild(input);
});
  1. Then in Settings > Notifications > New gift card, add this to display it:
{% for prop in gift_card.properties %}
  {% unless prop.last == blank %}
    <p style="text-align: center;">{{ prop.first }}: {{ prop.last }}</p>
  {% endunless %}
{% endfor %}

Option 2: Match by price (simpler but limited)

If your variants all have unique prices, you can match the gift card value to display custom text:

{% if gift_card.initial_value == 1000 %}
  <p>Child Shoes - {{ gift_card.initial_value | money }}</p>
{% elsif gift_card.initial_value == 2000 %}
  <p>Adult Shoes - {{ gift_card.initial_value | money }}</p>
{% else %}
  <p>{{ gift_card.initial_value | money }}</p>
{% endif %}

Note: initial_value is in cents/pence, so £10 = 1000

The first option is more maintainable but requires theme code changes. The second is hacky but quick if you only have a few variants with unique prices.

The proper fix would be for Shopify to make gift_card.product.selected_variant actually work - might be worth submitting feedback to them.

Best,
Shubham | Untechnickle