Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hello, I am running a webstore selling footwear which allows users to select a "Not Sure" size option if they are not sure of the size of the footwear. Those who purchase the "Not Sure" size option would receive a sizing kit and a gift card that could be used to offset their purchase once they have determined the size of the footwear.
I've created a shopify flow process (see below) that allows me to send a gift card via email to those who purchase the "Not Sure" size variant, however, I would also like to insert a custom message in the gift card notification that is based on conditional logic.
I have tried the following code in the new gift card template- 2 methods, 1 using the note field with the note inserted into the gift card. The other using the customer tags field. However, both don't seem to be working. Was wondering if anyone had any success with customising gift card templates to show a message based on a condition. Any form of help is appreciated, thanks!
<!-- Method 1-->
{% if gift_card.note contains "Not Sure" %}
<p style="font-size: 16px; margin-bottom: 20px;">
Thank you for your purchase! Kindly use this gift card to offset your purchase once you've used the sizing kit to confirm the child's size.
</p>
{% endif %}
<!-- Method 2-->
{% if customer.tags contains "NotSureGiftCard" %}
<p>Thank you for your purchase! Kindly use this gift card to offset your purchase once you've used the sizing kit to confirm the child's size.</p>
{% endif %}
Solved! Go to the solution
This is an accepted solution.
The solution is in https://community.shopify.com/c/shopify-flow-app/automatically-issue-digital-gift-card-post-purchase...
Briefly -- card_note does not work because it's not available in Liquid;
customer tag does not work because in Gift card context customer is the person who've purchased the card while the person for whom this card is intended is a recipient.
So the code should be like
{% if recepient.tags contains "NotSureGiftCard" %}
<p>...</p>
{% endif %}
This is an accepted solution.
The solution is in https://community.shopify.com/c/shopify-flow-app/automatically-issue-digital-gift-card-post-purchase...
Briefly -- card_note does not work because it's not available in Liquid;
customer tag does not work because in Gift card context customer is the person who've purchased the card while the person for whom this card is intended is a recipient.
So the code should be like
{% if recepient.tags contains "NotSureGiftCard" %}
<p>...</p>
{% endif %}
For those browsing for the solution, here it is courtesy of Tim
First, create the following process in flow
Then, enter the details in the Send Admin API Request (GiftCardCreate mutation) - the solution was calling the field "templateSuffix: "
Lastly, insert the following liquid code in your gift card notification email template
{% if gift_card.template_suffix == "not-sure" %} <p style="font-size: 16px; margin-bottom: 10px;"> Thank you for your purchase! Kindly use this gift card to offset... </p> {% endif %}