Send a follow-up email after order cancellation, with Mechanic.

Mechanic is a development and ecommerce automation platform for Shopify. :)

Send a follow-up email after order cancellation

Use this task to easily check in on customers, after an order of theirs is cancelled. Optionally, queue up the email for a certain number of hours from the time of cancellation.

Runs Occurs whenever an order is cancelled. Configuration includes only send for first time customers, hours to wait after cancellation, email subject, and email body.

15-day free trial – unlimited tasks

Developer details

Mechanic is designed to benefit everybody: merchants, customers, developers, agencies, Shopifolks, 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.

(By the way, have you seen our documentation? Have you joined the Slack community?)

Open source
View on GitHub to contribute to this task
Subscriptions
shopify/orders/cancelled{% if options.hours_to_wait_after_cancellation__number != blank %}+{{ options.hours_to_wait_after_cancellation__number }}.hours{% endif %}
Tasks use subscriptions to sign up for specific kinds of events. Learn more
Options
only send for first time customers (boolean), hours to wait after cancellation (number), email subject (required), email body (multiline, required)
Code
{% comment %}
  Preferred option order:

  {{ options.only_send_for_first_time_customers__boolean }}
  {{ options.hours_to_wait_after_cancellation__number }}
  {{ options.email_subject__required }}
  {{ options.email_body__multiline_required }}
{% endcomment %}

{% assign order_qualifies = false %}

{% if order.email != blank %}
  {% if options.only_send_for_first_time_customers__boolean %}
    {% if order.customer.reload.orders_count == 1 %}
      {% assign order_qualifies = true %}
    {% endif %}
  {% else %}
    {% assign order_qualifies = true %}
  {% endif %}
{% endif %}

{% if event.preview or order_qualifies %}
  {% action "email" %}
    {
      "to": {{ order.email | json }},
      "subject": {{ options.email_subject__required | json }},
      "body": {{ options.email_body__multiline_required | newline_to_br | json  }},
      "reply_to": {{ shop.customer_email | json }},
      "from_display_name": {{ shop.name | json }}
    }
  {% endaction %}
{% endif %}
Task code is written in Mechanic Liquid, an extension of open-source Liquid enhanced for automation. Learn more
Defaults
Email subject
Following up on order {{ order.name }}
Email body
Hello,

We received your cancellation. Is there anything else we can do for you?

Thanks,
{{ shop.name  }}