Send a staff notification email for each delivery
Use this task to send a staff email, the moment Shopify registers a successful delivery.
Try this taskWhen it runs
Occurs whenever a fulfillment event is created
What you choose
- Email recipient
- Email subject
- Email body
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/fulfillment_events/create
How task subscriptions work
Option types and flags
- Email recipient (email, required)
- Email subject (required)
- Email body (multiline, required)
Task code
{% 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 Liquid reference
Default option values
- 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