Remind customers that their order is on the way, with Mechanic.

Mechanic is a development platform for Shopify. :)

Remind customers that their order is on the way

Do you ship custom items, or do you have a lengthy turnaround time on your orders? Use this task to automatically re-assure customers that their order is in the queue, to be shipped as soon as possible. By default, this task sends an email 10 days (or a number you configure) after the order is paid, as long as the order remains fully paid, unfulfilled, and un-cancelled. Optionally, configure tags to add to the order and/or customer, to be added when the email is sent, and choose whether to only send reminders on weekdays.

Runs when an order is paid and when user/order/customer_reminder is triggered. Configuration includes number of days to wait, only send reminders on weekdays, email subject, email body, tag to add to order, and tag to add to customer.

15-day free trial – unlimited tasks

Documentation

Do you ship custom items, or do you have a lengthy turnaround time on your orders? Use this task to automatically re-assure customers that their order is in the queue, to be shipped as soon as possible. By default, this task sends an email 10 days (or a number you configure) after the order is paid, as long as the order remains fully paid, unfulfilled, and un-cancelled. Optionally, configure tags to add to the order and/or customer, to be added when the email is sent, and choose whether to only send reminders on weekdays.

Use the variables ORDER_NUMBER and CUSTOMER_FIRST_NAME to insert each of these values into your email subject and body respectively.

Note: When the "Only send reminders on weekdays" option is chosen, any emails that would have been sent on a weekend are instead emailed the following Monday.

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.

Open source
View on GitHub to contribute to this task
Events
when an order is paid (shopify/orders/paid)
when user/order/customer_reminder is triggered (user/order/customer_reminder)
Options
number of days to wait (number, required), only send reminders on weekdays (boolean), email subject (required), email body (multiline, required), tag to add to order, tag to add to customer
Script
{% if event.topic == "shopify/orders/paid" %}
  {% if event.preview %}
    {% assign order = hash %}
    {% assign order["admin_graphql_api_id"] = "gid://shopify/Order/1234567890" %}
    {% assign order["fulfillment_status"] = nil %}
  {% endif %}

  {% if order.fulfillment_status == blank or order.fulfillment_status == "partial" %}
    {% assign one_day_in_seconds = 60 | times: 60 | times: 24 %}
    {% assign days_to_wait = options.number_of_days_to_wait__number_required | default: 10 %}
    {% assign days_to_wait_in_seconds = days_to_wait | times: one_day_in_seconds %}
    {% assign run_at = "now" | date: "%s" | plus: days_to_wait_in_seconds %}

    {% if options.only_send_reminders_on_weekdays__boolean %}
      {% assign run_at_day = run_at | date: "%w" %}

      {% if run_at_day == "0" %}{% comment %}-- Sunday --{% endcomment %}
        {% assign run_at = run_at | plus: one_day_in_seconds %}
      {% elsif run_at_day == "6" %}{% comment %}-- Saturday --{% endcomment %}
        {% assign run_at = run_at | plus: one_day_in_seconds | plus: one_day_in_seconds %}
      {% endif %}
    {% endif %}

    {% action "event" %}
      {
        "topic": "user/order/customer_reminder",
        "task_id": {{ task.id | json }},
        "run_at": {{ run_at | json }},
        "data": {
          "order_id": {{ order.admin_graphql_api_id | json }}
        }
      }
    {% endaction %}
  {% endif %}
{% elsif event.topic == "user/order/customer_reminder" %}
  {% assign order_id = event.data.order_id %}

  {% capture order_query %}
    query {
      order(id: {{ order_id | json }}) {
        id
        name
        email
        fullyPaid
        displayFulfillmentStatus
        cancelledAt
        customer {
          id
          firstName
        }
      }
    }
  {% endcapture %}

  {% assign order_result = order_query | shopify %}

  {% if event.preview %}
    {% capture order_result_json %}
      {
        "data": {
          "order": {
            "id": "gid://shopify/Order/1234567890",
            "name": "#1234",
            "email": "charlie.customer@example.com",
            "fullyPaid": true,
            "displayFulfillmentStatus": "UNFULFILLED",
            "cancelledAt": null,
            "customer": {
              "id": "gid://shopify/Customer/1234567890",
              "firstName": "Charlie"
            }
          }
        }
      }
    {% endcapture %}

    {% assign order_result = order_result_json | parse_json %}
  {% endif %}

  {% assign order = order_result.data.order %}

  {% if order.cancelledAt == blank and order.fullyPaid %}
    {% if order.displayFulfillmentStatus == "UNFULFILLED" or order.displayFulfillmentStatus == "PARTIALLY_FULFILLED" %}
      {% assign customer_first_name = order.customer.firstName | default: "there" %}
      {% assign email_subject = options.email_subject__required | replace: "ORDER_NAME", order.name %}
      {% assign email_body = options.email_body__multiline_required | strip | newline_to_br | replace: "CUSTOMER_FIRST_NAME", customer_first_name %}

      {% action "email" %}
        {
          "to": {{ order.email | json }},
          "subject": {{ email_subject | json }},
          "body": {{ email_body | json }},
          "reply_to": {{ shop.customer_email | json }},
          "from_display_name": {{ shop.name | json }}
        }
      {% endaction %}

      {% if options.tag_to_add_to_order != blank %}
        {% action "shopify" %}
          mutation {
            tagsAdd(
              id: {{ order.id | json }}
              tags: {{ options.tag_to_add_to_order | json }}
            ) {
              userErrors {
                field
                message
              }
            }
          }
        {% endaction %}
      {% endif %}

      {% if options.tag_to_add_to_customer != blank %}
        {% action "shopify" %}
          mutation {
            tagsAdd(
              id: {{ order.customer.id | json }}
              tags: {{ options.tag_to_add_to_customer | json }}
            ) {
              userErrors {
                field
                message
              }
            }
          }
        {% endaction %}
      {% endif %}
    {% endif %}
  {% endif %}
{% endif %}
Mechanic tasks are written in Liquid, which makes them easy to write and easy to modify. Learn more about our platform.
Defaults
Number of days to wait
10
Email subject
Don't worry – ORDER_NAME is still coming!
Email body
Hi CUSTOMER_FIRST_NAME,

Thank you for your order! We're writing to let you know that your order is still enqueued, and will be shipped to you as soon as it's ready. :)

Just reply to this email if you have any questions.

Thanks,
{{ shop.name }}