How to Add a Gift Message to Shopify Refund Emails

2026-10-31 · shipping fulfillment

Gift messages are one of the first things to break when an order gets refunded. A customer buys a birthday gift, types "Happy 30th, Maya!" into the cart note or a gift message field, the recipient opens the package, and then a partial refund lands in the buyer's inbox as a bare, transactional receipt with no context. The gift message you carefully captured at checkout doesn't appear in Shopify's refund notification by default, because that email pulls from a different set of variables than the order confirmation. This guide shows you how to add the gift message back into the refund email, what Shopify's notification editor will and won't let you do, and where the free approach stops working.

Why Gift Messages Vanish on Refunds (and Why It Matters)

Shopify's refund notification is triggered by the refund event, not the order event. Its template has access to order-level data (line items, totals, shipping address) but the default template doesn't render the order's note attributes or cart attributes — the fields where most gift message apps and themes store the message. So even though the data still exists on the order, the refund email simply doesn't print it.

That matters more than it sounds. A refund email is often the only communication a buyer gets after something goes wrong — a damaged item, a wrong size, a canceled preorder. If the order was a gift, the buyer may be managing the refund on behalf of someone else, and the refund email is their paper trail. A refund email that references the gift ("Refund for the gift order to Maya") reads as competent customer service. One that reads like a raw transaction receipt reads like a system that forgot the customer.

There's a second reason: consistency. If your order confirmation, shipping confirmation, and refund email all reference the gift message, the customer experience holds together. If only some of them do, the gap is noticeable.

Before You Edit: What Shopify Refund Emails Can and Can't Do

Shopify's notification templates use Liquid, and you can edit them in Settings → Notifications → Customer notifications → Refund (wording varies slightly by admin version; look for the refund entry in the list of customer notifications). What you can do:

What you can't do natively:

That last point is the most common failure. Before editing anything, open a recent gift order in the admin and check the Additional details / order attributes section. If the gift message is there as a note attribute, you're in good shape. If it's only in the cart, you'll need to fix capture first — most gift message apps (and Shopify's own cart note field) do write to the order, but custom theme code sometimes doesn't.

Step 1: Locate the Right Notification Template

  1. In Shopify admin, go to Settings → Notifications.
  2. Under Customer notifications, find Refund (sometimes labeled "Refund confirmation" or similar). Click it.
  3. Confirm you're editing the customer refund email, not the staff-facing refund notification or the order cancellation email. They're separate templates and editing the wrong one is the most common mistake here.
  4. Click Edit code. You'll see the HTML/Liquid for the email body.

Take a copy of the current template before you change anything — paste it into a text file. Shopify doesn't version notification templates, so that copy is your rollback.

While you're here, note how the template references line items. Most default refund templates loop through refund.refund_line_items or list the refunded items. You'll place the gift message block near the top of the email body, above the refund summary, so it's the first thing the customer reads.

Step 2: Add the Gift Message to the Refund Email Template

The goal is a block that renders only when a gift message exists. Gift messages typically live in one of two places, so handle both:

Insert this block near the top of the email body, inside the main content container:

{% assign gift_message = order.attributes['Gift message'] | default: order.note %}
{% if gift_message != blank %}
  <div style="border-left: 3px solid #1a1a1a; padding: 12px 16px; margin: 0 0 24px; background: #f7f7f7;">
    <p style="margin: 0 0 6px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #666;">Gift message on this order</p>
    <p style="margin: 0; font-size: 15px; line-height: 1.5; color: #1a1a1a;">{{ gift_message | escape }}</p>
  </div>
{% endif %}

Three things to get right:

Save the template. Shopify applies changes immediately to future refund emails.

Step 3: Test With a Real Partial Refund and Full Refund

Don't ship this on a live store without testing both refund types, because Shopify handles them differently in the template.

  1. Place a test order with a gift message filled in at checkout. Use a real payment method or Shopify's test mode, depending on your setup.
  2. From the order page, issue a partial refund on one line item. Check the email that arrives — the gift message block should appear above the refunded item summary.
  3. Issue a full refund on a second test order. Confirm the block still renders and the message text is intact, including apostrophes and line breaks.
  4. Place a third order without a gift message and refund it. The block should not appear at all — no empty grey box, no stray label.

If the block doesn't render on the partial refund, the most likely cause is that the refund email for partial refunds is the same template but the attribute key differs by order source (e.g., POS vs. online). Check the order's attributes directly in the admin for each test order.

Test scenario What to check Common failure
Partial refund, gift order Gift block appears above refunded items Attribute key mismatch
Full refund, gift order Message text intact, punctuation preserved Unescaped characters breaking layout
Refund, non-gift order No block, no empty container Missing {% if %} wrapper
Refund after order edit Message reflects current attribute Stale data from app sync delay

Edge Cases: Partial Cancellations, Multiple Items, and Gift Cards

Partial cancellations. A cancellation is a different event from a refund. If you cancel line items, Shopify may send a cancellation email rather than a refund email, and that template needs the same gift block added separately. Check both templates.

Multiple items, one gift message. If a buyer ordered three items and gifted one, the gift message applies to the whole order, not the line item. The block will show on any refund for that order. That's usually fine, but if you sell mixed orders (some gifted, some not), consider asking gift apps to store the message as a line item property instead, which lets you scope the block to refunded line items using refund.refund_line_items.

Gift cards. Gift card orders don't carry shipping details and often skip the gift message field entirely. If you sell gift cards as gifts, capture the recipient's email as a line item property and reference it in the refund template the same way. Shopify's native gift card flow doesn't include a message field, so this usually requires a third-party app or a theme customization.

Refunds issued from Shopify POS or a third-party helpdesk (Gorgias, Zendesk, etc.) still use the same notification template, but the order attributes may not sync instantly. If a support agent issues a refund within minutes of the order being edited, the email can go out with stale data. A short delay before refunding, or a manual check, avoids it.

When a Free Workaround Isn't Enough

The Liquid edit above is free and works for most stores. It stops being enough in a few specific situations:

For stores in that last group, evaluate notification apps (Shopify's own Email app, or third-party options like OrderlyEmails or similar) on three criteria: whether they can read order attributes, whether they support conditional blocks, and whether they let you preview a refund email before sending. Check current pricing directly on each app's listing — it changes, and the free tiers vary a lot.

Conclusion

Adding a gift message to Shopify refund emails is a template edit, not an app purchase, for most stores: find the refund notification, insert a conditional block that reads the order's gift attribute, and test both partial and full refunds before going live. The work is in verifying where your gift message is actually stored and handling the edge cases — cancellations, line-item gifts, and helpdesk-issued refunds — that the default template ignores. Do that once, and your refund emails stop reading like system receipts.

FAQ

Why doesn't my gift message show up in the refund email even though it's on the order? The default refund template doesn't reference order attributes. You have to add a Liquid block that reads the attribute key your gift app or theme uses — check a live order's attributes in the admin to confirm the exact key.

Can I show a different gift message for each refunded item? Only if the message is stored as a line item property rather than an order attribute. You'd loop through refund.refund_line_items and print the property for each item, which is more complex and depends on how your app stores the data.

Does editing the refund template affect emails already sent? No. Template changes apply only to refund emails sent after you save. Past emails are unchanged, so test on a staging order before editing a live store's template.