Auto-copy notes from customers to their orders, with Mechanic.

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

Auto-copy notes from customers to their orders

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.

Runs Occurs whenever an order is created and Occurs when a user manually triggers the task.

15-day free trial – unlimited tasks

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".)

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/create
mechanic/user/trigger
Tasks use subscriptions to sign up for specific kinds of events. Learn more
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 %}
Task code is written in Mechanic Liquid, an extension of open-source Liquid enhanced for automation. Learn more