Remind customers after x days about unpaid orders, with Mechanic.

Mechanic is an automation development platform for Shopify. :)

Remind customers after x days about unpaid orders

by Isaac Bowen (team@usemechanic.com)

This task wait for a configurable number of days (or hours!) after an order placed, and – if the order is still unpaid – emails the customer, and optionally adds a tag to the order. This task only sends one email – it does not send repeating reminders.

Runs 7 days after an order is created. Configuration includes email subject, email body, tag to add to the order, number of days to wait, and use hours instead of days.

15-day free trial – unlimited tasks

Documentation

This task wait for a configurable number of days (or hours!) after an order placed, and – if the order is still unpaid – emails the customer, and optionally adds a tag to the order. This task only sends one email – it does not send repeating reminders.

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.

Events
7 days after an order is created (shopify/orders/create+7.days)
Options
email subject (required), email body (multiline, required), tag to add to the order, number of days to wait (number, required), use hours instead of days (boolean)
Script
{% unless event.preview %}
  {% assign order = order.reload %}
{% endunless %}

{% assign order_qualifies = false %}
{% if order.financial_status == "pending" and order.cancelled_at == blank %}
  {% assign order_qualifies = true %}
{% endif %}

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

  {% if options.tag_to_add_to_the_order != blank %}
    {% action "shopify" %}
      mutation {
        tagsAdd(
          id: {% if event.preview %}"gid://shopify/Order/1234567890"{% else %}{{ order.admin_graphql_api_id | json }}{% endif %}
          tags: {{ options.tag_to_add_to_the_order | json }}
        ) {
          userErrors {
            field
            message
          }
        }
      }
    {% endaction %}
  {% endif %}
{% endif %}
Mechanic tasks are written in Liquid, which makes them easy to write and easy to modify. Learn more about our platform.
Defaults
Email subject
Don't forget! Order #{{ order.order_number }} still needs to be paid
Email body
Hi there,

Your payment is still required! Please get in touch at {{ shop.customer_email }} to proceed.

Thanks,
{{ shop.name }}
Number of days to wait
7