Notify a team when a tagged product is ordered, with Mechanic.

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

Notify a team when a tagged product is ordered

Quickly route order notifications to whichever teams need be alerted for a given order. Use product tags to mark products according to which team needs the alert, and add multiple copies of this task to alert different teams for different tags.

Runs Occurs whenever an order is created. Configuration includes required product tag, team email, email subject, and email body.

15-day free trial – unlimited tasks

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
Tasks use subscriptions to sign up for specific kinds of events. Learn more
Options
required product tag (required), team email (required), email subject (required), email body (multiline, required)
Code
{% assign order_qualifies = false %}
{% assign order_product_tags = order.line_items | map: "product" | map: "tags" | join: ", " | split: ", " | sort | uniq %}
{% if order_product_tags contains options.required_product_tag__required %}
  {% assign order_qualifies = true %}
{% endif %}

{% if event.preview or order_qualifies %}
  {
    "action": {
      "type": "email",
      "options": {
        "to": {{ options.team_email__required | json }},
        "subject": {{ options.email_subject__required | json }},
        "body": {{ options.email_body__multiline_required | strip | newline_to_br | json }},
        "reply_to": {{ shop.customer_email | json }},
        "from_display_name": {{ shop.name | json }}
      }
    }
  }
{% elsif order_qualifies == false %}
  {% capture log_message %}Order tags did not include {{ options.required_product_tag__required | json }} (found {{ order_product_tags | json }}){% endcapture %}
  {"log": {{ log_message }}}
{% endif %}
Task code is written in Mechanic Liquid, an extension of open-source Liquid enhanced for automation. Learn more
Defaults
Required product tag
requires-art
Team email
art-department@example.com
Email subject
Order {{ order.order_number }} requires custom artwork
Email body
Hello,

Please see details for order {{ order.order_number }}:

https://{{ shop.myshopify_domain }}/admin/orders/{{ order.id }}

Thanks,
- Mechanic, for {{ shop.name }}