Mechanic is a development and ecommerce automation platform for Shopify. :)
This task sends a new-order email alert to somebody specific, based on the contents of a cart attribute. Useful for allowing customers to select their salesperson, alerting the appropriate salesperson when the order is placed.
Runs Occurs whenever an order is created. Configuration includes cart attribute name, cart attribute values and email addresses, email subject, email body, and only send for paid orders.
This task sends a new-order email alert to somebody specific, based on the contents of a cart attribute. Useful for allowing customers to select their salesperson, alerting the appropriate salesperson when the order is placed.
This task sends a new-order email alert to somebody specific, based on the contents of a cart attribute. If a matching email address is not found in the task's configuration, no email will be sent.
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?)
{% if options.only_send_for_paid_orders__boolean %} shopify/orders/paid {% else %} shopify/orders/create {% endif %}
{% if event.preview %} {% assign order = order | json | parse_json %} {% assign order["note_attributes"][0] = hash %} {% assign order["note_attributes"][0]["name"] = options.cart_attribute_name__required %} {% assign order["note_attributes"][0]["value"] = options.cart_attribute_values_and_email_addresses__keyval_email_required.first.first %} {% endif %} {% assign attribute = order.note_attributes | where: "name", options.cart_attribute_name__required | first %} {% assign attribute_value = attribute.value %} {% assign email = options.cart_attribute_values_and_email_addresses__keyval_email_required[attribute_value] %} {% if attribute == nil %} {"log": {{ options.cart_attribute_name__required | json | prepend: "This order did not contain the attribute " | json }}} {% elsif email == blank %} {"log": {{ attribute_value | json | prepend: "There is no configured email corresponding with " | json }}} {% else %} {% action "email" %} { "to": {{ email | 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 }} } {% endaction %} {% endif %}
Salesperson
{"Jenny "=>"jenny@example.com", "Zhang Wei"=>"zhangwei@example.com"}
You've got an order! {{ order.name }}
Hello, An order has arrived, and it's assigned to you. https://{{ shop.domain }}/admin/orders/{{ order.id }} Thanks, {{ shop.name }}