Auto-tag new orders
Immediately upon order creation, add one or more tags to the order. Simple as that. :)
Try this taskWhen it runs
Occurs whenever an order is created
What you choose
Order tags to add
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
How task subscriptions work
Option types and flags
- Order tags to add (array, required)
Task code
{% if event.preview %}
{% assign order = hash %}
{% assign order["admin_graphql_api_id"] = "gid://shopify/Order/1234567890" %}
{% endif %}
{% action "shopify" %}
mutation {
tagsAdd(
id: {{ order.admin_graphql_api_id | json }}
tags: {{ options.order_tags_to_add__array_required | json }}
) {
userErrors {
field
message
}
}
}
{% endaction %}
Mechanic Liquid reference