Send an email alert when a fulfillment is cancelled, with Mechanic.

Mechanic is a development platform for Shopify. :)

Send an email alert when a fulfillment is cancelled

by Isaac Bowen (

Useful for keeping an eye on unexpected cancellations by third party shipping services.

Runs when a fulfillment is updated. Configuration includes email recipient, email subject, and email body.

15-day free trial – unlimited tasks


This task performs two actions: one to send an email, and one to "remember" that an email has been sent. (Without this second action, this task would send an email every time a cancelled fulfillment is updated.)

Developer details

Mechanic is designed to benefit everybody: merchants, customers, developers, agencies, Gurus, everybody.

That’s why we make it easy to configure automation without code, why we make it easy to tweak the underlying code once tasks are installed, and why we publish it all here for everyone to learn from.

when a fulfillment is updated (shopify/fulfillments/update)
email recipient (email, required), email subject (required), email body (multiline, required)
{% assign fulfillment_qualifies = false %}
{% assign cache_key = | append: | sha256 %}

{% if fulfillment.status == "cancelled" and cache[cache_key] == blank %}
  {% assign fulfillment_qualifies = true %}
{% endif %}

{% if event.preview or fulfillment_qualifies %}
  {% action "email" %}
      "to": {{ options.email_recipient__email_required | json }},
      "subject": {{ options.email_subject__required | json }},
      "body": {{ options.email_body__multiline_required | strip | newline_to_br | json }},
      "reply_to": {{ shop.customer_email | json }},
      "from_display_name": {{ | json }}
  {% endaction %}

  {% action "cache", "set", cache_key, true %}
{% endif %}
Mechanic tasks are written in Liquid, which makes them easy to write and easy to modify. Learn more about our platform.
Email subject
A fulfillment for order {{ | default: "an order" }} was cancelled
Email body

A fulfillment with {{ fulfillment.line_items.size }} line item(s) was cancelled.

<a href="https://{{ shop.domain }}/admin/orders/{{ }}">Manage this order in Shopify</a>

Mechanic, for {{ }}