-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathsend-a-staff-notification-email-for-each-delivery.json
24 lines (24 loc) · 1.7 KB
/
send-a-staff-notification-email-for-each-delivery.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
"docs": "Use this task to send a staff email, the moment Shopify registers a successful delivery.",
"halt_action_run_sequence_on_error": false,
"name": "Send a staff notification email for each delivery",
"online_store_javascript": null,
"options": {
"email_recipient__email_required": null,
"email_subject__required": "Fulfillment {{ fulfillment_event.fulfillment.name | default: \"#1234.1\" }} has been delivered!",
"email_body__multiline_required": "For more details, see order {{ fulfillment_event.order.name | default: \"#1234\" }} in Shopify:\n\nhttps://{{ shop.domain }}/admin/orders/{{ fulfillment_event.order_id }}\n\nThanks,\nMechanic"
},
"order_status_javascript": null,
"perform_action_runs_in_sequence": false,
"script": "{% if event.preview %}\n {% assign fulfillment_event = hash %}\n {% assign fulfillment_event[\"status\"] = \"delivered\" %}\n{% endif %}\n\n{% if fulfillment_event.status == \"delivered\" %}\n {% action \"email\" %}\n {\n \"to\": {{ options.email_recipient__email_required | json }},\n \"subject\": {{ options.email_subject__required | json }},\n \"body\": {{ options.email_body__multiline_required | newline_to_br | json }},\n \"reply_to\": {{ shop.customer_email | json }},\n \"from_display_name\": {{ shop.name | json }}\n }\n {% endaction %}\n{% else %}\n {% log fulfillment_event_status: fulfillment_event.status, fulfillment_name: fulfillment_event.fulfillment.name, order_name: fulfillment_event.order.name %}\n{% endif %}",
"subscriptions": [
"shopify/fulfillment_events/create"
],
"subscriptions_template": "shopify/fulfillment_events/create",
"tags": [
"Alert",
"Delivery",
"Email",
"Shipping"
]
}