Mechanic Get Mechanic
Task library

Auto-copy notes from customers to their orders

Bring a customer’s fulfillment instructions onto their new order. The task appends the customer note to any note already on the order.

Try this task

When it runs

When Shopify creates an order, or when you run the task manually for open orders.

Order note preview

Sample order

Order #1042

  1. Original order note

    Gift wrap, please.

  2. Note on the customer record

    Use the side entrance.

  3. Order note after the task runs

    Gift wrap, please. Use the side entrance.

Documentation

Save time jumping between screens, by making sure that the order record has everything you need. Useful for shops that keep important fulfillment information in the customer notes. This task can be run manually to back-fill notes for open orders.

This task runs automatically, whenever a new order is created.

Run this task manually to scan all open orders, copying the customer note to the order note. (To include open orders older than 60 days, enable "read all orders".)

Task code and subscriptions

You can edit the Liquid code after installing this task. View on GitHub or ask a question in the Mechanic Slack community.

Subscriptions

shopify/orders/create
mechanic/user/trigger
How task subscriptions work

Task code

{% capture newline %}
{% endcapture %}

{% if event.preview %}
  {
    "action": {
      "type": "shopify",
      "options": [
        "update",
        [
          "order",
          12345
        ],
        {
          "note": "(Note copied from customer)"
        }
      ]
    }
  }
{% elsif event.topic == "shopify/orders/create" %}
  {% if order.customer.note == blank %}
    {"log": "No note on file for this customer; skipping order update"}
  {% else %}
    {
      "action": {
        "type": "shopify",
        "options": [
          "update",
          [
            "order",
            {{ order.id | json }}
          ],
          {
            "note": {{ order.note | append: newline | append: newline | append: order.customer.note | strip | json }}
          }
        ]
      }
    }
  {% endif %}
{% elsif event.topic == "mechanic/user/trigger" %}
  {% for order in shop.orders.open %}
    {% assign order_note_downcased = order.note | downcase %}
    {% assign customer_note_downcased = order.customer.note | downcase %}

    {% unless customer_note_downcased == blank or order_note_downcased contains customer_note_downcased %}
      {
        "action": {
          "type": "shopify",
          "options": [
            "update",
            [
              "order",
              {{ order.id | json }}
            ],
            {
              "note": {{ order.note | append: newline | append: newline | append: order.customer.note | strip | json }}
            }
          ]
        }
      }
    {% endunless %}
  {% endfor %}
{% endif %}
Mechanic Liquid reference