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.
Getting started
Section titled “Getting started”In your Shopify admin, go to Settings → Notifications → Customer notifications. Under Order processing, click Order confirmation, then click Edit code.
Step 1 — Find where to paste the code
Section titled “Step 1 — Find where to paste the 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.
- Press Ctrl + F (or Cmd + F on Mac) and search for
Visit our store. - Go to the last match. Just below it you’ll see these lines:
{% endif %}{% endunless %}
{% endif %}- Place your cursor on the empty line after that last
{% endif %}, before the line that says</td>.
Step 2 — Paste the code
Section titled “Step 2 — Paste the code”{% 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>Step 3 — Save
Section titled “Step 3 — Save”Click Save at the top of the editor.
Step 4 — Test with a real order
Section titled “Step 4 — Test with a real order”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.
Troubleshooting
Section titled “Troubleshooting”- 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.