A user wants to display different gift card images in email notifications based on the purchase amount—Oak for amounts ≥1000 kr, Brass for ≥2000 kr, and Marble for ≥4000 kr.
Initial Solution Attempt:
Another user provided code using customer.total_spent conditions in the gift_card.liquid template file
This approach checks customer spending history rather than the specific gift card value
Implementation Issues:
The original poster reports syntax errors (red highlighting) when implementing the code
Subsequent attempts show no error messages but fail functionally:
Gift card emails not arriving with codes
Wrong images displaying in test emails
Current Status:
The discussion remains unresolved
The core problem appears to be using gift_card.initial_value (the actual gift card amount) versus customer.total_spent (customer’s historical spending)
The most recent code attempt includes conditional logic for three tiers but functionality is still broken
No working solution has been confirmed
Summarized with AI on November 5.
AI used: claude-sonnet-4-5-20250929.
We have three types of gift cards: Oak, Brass, and Marble. I would like the digital gift card (in PNG format) to be sent with the corresponding name on it.
Hi again I tried this one, which isnt showing any mistakes, but 1) the email with the gift card isn’t arriving with the code and its not showing the right gift card in the trial.
{% if gift_card.recipient %}
{% if gift_card.recipient.nickname != blank %}
{% assign recipient_name = gift_card.recipient.nickname %}
{% elsif gift_card.recipient.name != blank %}
{% assign recipient_name = gift_card.recipient.name %}
{% else %}
{% assign recipient_name = gift_card.recipient.email %}
{% endif %}
{% capture email_title %}
{% if gift_card.send_on != blank %}
Here’s your gift card that will be sent to {{ recipient_name }} on {{ gift_card.send_on | date: ‘%B %e, %Y’ }}.
{% else %}
Here’s your gift card that was sent to {{ recipient_name }}.
{% endif %}
{% endcapture %}
{% endif %}