Mastering Shopify's Return Approved Email: How to Dynamically Display Order Numbers

Hey fellow store owners!

Ever found yourself scratching your head trying to tweak a Shopify email notification, only to feel like you're speaking a different language than the theme files? You're definitely not alone. It's a super common hurdle, and it came up recently in a community thread where 'offroadjim' was wrestling with their "Return Approved" email notification.

offroadjim's goal was simple: they wanted the actual order number to show up in a specific spot within the return information section of that email. Currently, it was just displaying a generic "Return #####" placeholder, even though the order number was already visible at the top right of the email. Sounds straightforward, right? Well, as offroadjim put it, they "spent hours today trying to figure it out." This is exactly the kind of thing that can eat up your precious time if you don't know the specific trick.

The "Why" Behind the Head-Scratcher: Liquid Variables in Email vs. Theme

One of the most valuable insights from the thread came from 'gracetech1', who perfectly articulated why this can be so confusing: "Shopify’s notification templates can be a little confusing at first since they use separate Liquid variables from the actual theme files." This is key! If you're used to customizing your theme with Liquid, you might expect the same variables to work seamlessly in your email templates. But often, they don't. Email templates have their own set of available Liquid objects and properties, which sometimes differ from what's available in your storefront theme.

Understanding this distinction is half the battle. Once you know you're looking for email-specific Liquid, the path becomes clearer.

Putting the Order Number Where It Belongs: A Step-by-Step Guide

Let's get down to brass tacks. Based on the excellent advice from 'PaulMartin_1' and 'gracetech1' in the community discussion, here's how you can update your "Return Approved" email to dynamically display the order number.

Step 1: Navigate to Your Email Notification Templates

  1. From your Shopify admin, go to Settings.
  2. Click on Notifications.
  3. Scroll down to the Customer notifications section.
  4. Find and click on the Return approved notification to open its template for editing.

Step 2: Locate the Placeholder Text

Inside the HTML/Liquid code for the "Return approved" template, you'll need to find the specific line that offroadjim pointed out. Look for something similar to this:

Return #####

This is the spot where you want the dynamic order number to appear.

Step 3: Replace with the Correct Liquid Variable

The community experts quickly identified the right Liquid variable for this job: {{ order.name }}. This variable reliably pulls the order's unique identifier (which Shopify calls the 'name' but we typically refer to as the order number) into your email.

So, you'll replace the placeholder line with:

Return {{ order.name }}

If you want to be super precise and match gracetech1's full example, that section might look something like this:

Return {{ order.name }}

This ensures the order number automatically displays inside the return information section, making it crystal clear for your customers.

Step 4: Test, Test, Test! (And Consider Alternatives)

Before you hit save and make it live, it's crucial to test your changes. Shopify provides a "Send test email" function, or you can preview the template. This lets you see exactly how the email will look with real data.

A great point raised by gracetech1 was to watch out for alternative variables. While {{ order.name }} is usually the go-to for the primary order number, some return notification templates might actually use {{ return.name }}, especially depending on how the return was created (e.g., if it's generated directly from a return object rather than the original order object). If {{ order.name }} doesn't seem to work, or gives you an empty value, {{ return.name }} is definitely worth testing in preview mode as your next step.

PaulMartin_1 also briefly mentioned {{ po_number }}. While less common for displaying the primary order number, it's a good reminder that Shopify's Liquid variables are extensive, and sometimes you might need to dig a little to find the exact one for your specific data point.

Beyond the Fix: General Tips for Email Customization

offroadjim's experience, and the helpful responses from the community, really highlight a few key takeaways for anyone customizing Shopify email notifications:

  • Embrace the Preview: Always use the preview function. It's your best friend for catching errors and ensuring your emails look perfect before they land in a customer's inbox.
  • Understand Liquid Context: Remember gracetech1's advice about email Liquid variables being different from theme Liquid. If something isn't working, consider if you're using a variable that's not available in the email's context.
  • Lean on the Community: Don't be afraid to ask for help! The Shopify Community forums are packed with experienced store owners and developers who've likely faced (and solved) similar challenges.
  • Backup Your Code: Before making significant changes, it's always a good idea to copy and paste the original template code into a text file. That way, if anything goes wrong, you can easily revert.

It's these small, thoughtful touches like dynamically displaying the order number that elevate your customer experience. It reduces confusion, makes your communication clearer, and ultimately, helps build trust. So, next time you're diving into your notification templates, remember these tips, and don't hesitate to leverage the collective wisdom of the Shopify community!

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases