Support Center

How do I show the discount code used for an order in my New Order Notification emails?

Last Updated: Sep 07, 2011 08:01PM EDT

Go to Preferences → Email & Notifications:

Click on the big New Order Notification button:

In the body of your email template, add the following code, then save:

{% if discounts %}Discount code: {{ discounts.first.code }}{% endif %}

Currently, there can only be one discount applied per order (not applicable, but applied), so the discounts “array” will only contain 0 or 1 element, but it may be possible to apply many discount codes to the same order in the future. When Shopify implements that, the Liquid code to use will become:

{% if discounts %}Discount {{ discounts.size | pluralize: 'code', 'codes' }}:{% for discount in discounts %} {{ discount.code }}{% endfor %}{% endif %}

Contact Us

  • Or call 1.888.746.7439
    Phone Support Hours
    • Monday - Friday 9am - 9pm EST
    • Saturday 9am - 5pm EST
    • Sunday Closed