Send a staff notification email for each delivery, with Mechanic.

Mechanic is a development platform for Shopify. :)

Send a staff notification email for each delivery

by Isaac Bowen (team@usemechanic.com)

Use this task to send a staff email, the moment Shopify registers a successful delivery.

Runs when a fulfillment event is created. Configuration includes email recipient, email subject, and email body.

15-day free trial – unlimited tasks

Documentation

Use this task to send a staff email, the moment Shopify registers a successful delivery.

Developer details

Mechanic is designed to benefit everybody: merchants, customers, developers, agencies, Gurus, 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.

Events
when a fulfillment event is created (shopify/fulfillment_events/create)
Options
email recipient (email, required), email subject (required), email body (multiline, required)
Script
{% if event.preview %}
  {% assign fulfillment_event = hash %}
  {% assign fulfillment_event["status"] = "delivered" %}
{% endif %}

{% if fulfillment_event.status == "delivered" %}
  {% action "email" %}
    {
      "to": {{ options.email_recipient__email_required | json }},
      "subject": {{ options.email_subject__required | json }},
      "body": {{ options.email_body__multiline_required | newline_to_br | json }},
      "reply_to": {{ shop.customer_email | json }},
      "from_display_name": {{ shop.name | json }}
    }
  {% endaction %}
{% else %}
  {% log fulfillment_event_status: fulfillment_event.status, fulfillment_name: fulfillment_event.fulfillment.name, order_name: fulfillment_event.order.name %}
{% endif %}
Mechanic tasks are written in Liquid, which makes them easy to write and easy to modify. Learn more about our platform.
Defaults
Email subject
Fulfillment {{ fulfillment_event.fulfillment.name | default: "#1234.1" }} has been delivered!
Email body
For more details, see order {{ fulfillment_event.order.name | default: "#1234" }} in Shopify:

https://{{ shop.domain }}/admin/orders/{{ fulfillment_event.order_id }}

Thanks,
Mechanic