Skip to content

Adding a Manage Subscription Button to Order Emails

Add a Manage your subscription button to Shopify’s order confirmation email, right below View your order. The button appears only when the order contains a subscription product — one-time orders aren’t affected.

In your Shopify admin, go to Settings → Notifications → Customer notifications. Under Order processing, click Order confirmation, then click Edit code.

The template shows the View your order button in a few different ways depending on the order. To make the subscription button appear in every case, you’ll paste the code after that whole block.

  1. Press Ctrl + F (or Cmd + F on Mac) and search for Visit our store.
  2. Go to the last match. Just below it you’ll see these lines:
{% endif %}{% endunless %}
{% endif %}
  1. Place your cursor on the empty line after that last {% endif %}, before the line that says </td>.
{% assign subsy_has_subscription = false %}
{% for line in line_items %}{% if line.selling_plan_allocation %}{% assign subsy_has_subscription = true %}{% endif %}{% endfor %}
{% if subsy_has_subscription %}
<table class="row actions"><tr><td class="actions__cell"><table class="button main-action-cell"><tr>
<td class="button__cell"><a href="{{ shop.url }}/apps/subscription/customer-portal" class="button__text">Manage your subscription</a></td>
</tr></table></td></tr></table>
{% endif %}

After pasting, that part of the template should look like this:

{% endif %}
{% assign subsy_has_subscription = false %}
... (the code you pasted) ...
{% endif %}
</td>
</tr>
</table>
</center>

Click Save at the top of the editor.

Place a test order for a subscription product on your storefront, then open the order confirmation email. Manage your subscription should appear below View your order. Click it to check the Customer Portal opens.

  • The button doesn’t appear — check the order contains a subscription product, not a one-time purchase.
  • The button appears on every order — check you copied the full code, including the first three lines.
  • The email layout looks broken — the code may be pasted inside another block. Click Revert to default, then follow Step 1 again.