All things Shopify and commerce
When customers purchase gift cards , they can indicate a recipient, and that info can also be added in the email . The problem is that the recipient of the gift card never knows who sent them a gift card and end up having to write to customer service to find out. So, somebody please tell me whats issue with our present email template below mentioned
Am I missing something here or is there another way I can display this submitted message in the Gift Card notification email?
template code used -
{% if gift_card.customer %}
{% if gift_card.customer.name != blank %}
{% assign sender_name = gift_card.customer.name %}
{% elsif gift_card.customer.email != blank %}
{% assign sender_name = gift_card.customer.email %}
{% else %}
{% assign sender_name = gift_card.customer.phone %}
{% endif %}
{% else %}
{% assign sender_name = Someone's %}
{% endif %}
{% capture email_body %}
{% if gift_card.expires_on %}
{{ sender_name }} given you the gift of a full fridge! Your {{ gift_card.balance | money_without_trailing_zeros }} gift card for {{ shop.name }} is now active. Click the link below to stock up, and reach out at hi@.com with any questions! Please keep this email handy or write down your gift card number.
{% else %}
{{ sender_name }} given you the gift of a full fridge! Your {{ gift_card.balance | money_without_trailing_zeros }} gift card for {{ shop.name }} is now active. Click the link below to stock up, and reach out at hi@.com with any questions! Please keep this email handy or write down your gift card number.
{% endif %}
{% endcapture %}
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ email_title }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="/assets/notifications/styles.css">
<style>
.button__cell { background: {{ shop.email_accent_color }}; }
a, a:hover, a:active, a:visited { color: {{ shop.email_accent_color }}; }
</style>
</head>
<body>
<table class="body">
<tr>
<td class="empty-line"> </td>
</tr>
<tr>
<td class="empty-line"> </td>
</tr>
<tr>
<td>
<table class="row content">
<tr>
<td class="content__cell">
<center>
<table class="container">
<tr>
<td>
<h1>{{ email_title }}</h1>
<table class="row actions">
<tr>
<td class="empty-line"> </td>
</tr>
</table>
<img src="https://cdn.shopify.com/s/files/files/Gift_Card_Front.png?v=1671635560" alt="Gift card image" width="240" height="160">
<table class="row actions">
<tr>
<td class="empty-line"> </td>
</tr>
</table>
{% if gift_card.message != blank %}
<table align="center" class="row giftcard__topmargin">
<tr>
<td class="giftcard__message">
Gift Message: {{ gift_card.message }}
</td>
</tr>
</table>
{% endif %}
<p>{{ email_body }}</p>
<table class="row actions">
<tr>
<td class="empty-line"> </td>
</tr>
<tr>
<td class="actions__cell">
<table class="button main-action-cell">
<tr>
<td class="button__cell"><a href="{{ gift_card.url }}" class="button__text"> Redeem Your Gift Card!</a></td>
</tr>
</table>
</td>
</tr>
</table>
<br />
{% if gift_card.pass_url %}
<a href="{{ gift_card.pass_url }}" class="apple-wallet-button">
<img src="{{ 'gift-card/add-to-apple-wallet.png' | shopify_asset_url }}" alt="Add to Apple Wallet" width="120" height="40">
</a>
{% endif %}
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
<table class="row footer">
<tr>
<td class="footer__cell">
<center>
<table class="container">
<tr>
<td>
<p class="disclaimer__subtext">If you have any questions, reply to this email or contact us at <a href="mailto:{{ shop.email }}">{{ shop.email }}</a></p>
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
<img src="{{ 'notifications/spacer.png' | shopify_asset_url }}" class="spacer" height="1" />
</td>
</tr>
</table>
</body>
</html>
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025