Send email when an order comes in, with Mechanic.

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

Send email when an order comes in

Use this task to notify staff (or suppliers, or anyone!) of incoming orders. Optionally, choose to only be notified when orders are paid, or only for orders that contain at least one product with a certain tag.

Runs Occurs whenever an order is created. Configuration includes only for orders including this product tag, email recipients, email subject, email body, and only for paid orders.

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
{% if options.only_for_paid_orders__boolean %}
  shopify/orders/paid
{% else %}
  shopify/orders/create
{% endif %}
Tasks use subscriptions to sign up for specific kinds of events. Learn more
Options
only for orders including this product tag, email recipients (required), email subject (required), email body (required, multiline), only for paid orders (boolean)
Code
{% assign order_qualifies = false %}
{% if options.only_for_orders_including_this_product_tag == blank %}
  {% assign order_qualifies = true %}
{% else %}
  {% assign order_product_tags = order.line_items | map: "product" | map: "tags" | join: ", " | split: ", " | sort | uniq %}
  {% if order_product_tags contains options.only_for_orders_including_this_product_tag %}
    {% assign order_qualifies = true %}
  {% endif %}
{% endif %}

{% if event.preview or order_qualifies %}
  {
    "action": {
      "type": "email",
      "options": {
        "to": {{ options.email_recipients__required | json }},
        "subject": {{ options.email_subject__required | strip | json }},
        "body": {{ options.email_body__required_multiline | newline_to_br | strip | json }},
        "reply_to": {{ shop.customer_email | json }},
        "from_display_name": {{ shop.name | json }}
      }
    }
  }
{% endif %}
Task code is written in Mechanic Liquid, an extension of open-source Liquid enhanced for automation. Learn more
Defaults
Email recipients
sales@example.com, production@example.com
Email subject
New {{ order.financial_status }} order: {{ order.name }}
Email body
Hi team,

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

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

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