forked from lightward/mechanic-tasks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcatalog-update-email.json
23 lines (23 loc) · 1.35 KB
/
catalog-update-email.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"docs": "Get an email alert whenever a product is created, updated, or deleted. This makes it easy to keep tabs on updates to your catalog – useful if you need a precise audit trail.",
"halt_action_run_sequence_on_error": false,
"name": "Catalog update email",
"online_store_javascript": null,
"options": {
"recipient_email__required_email": null
},
"order_status_javascript": null,
"perform_action_runs_in_sequence": false,
"script": "{% assign verb = event.topic | split: \"/\" | last %}\n\n{% capture email_subject %}Product {{ product.id }} {{ verb }}d{% endcapture %}\n\n{% capture email_body %}\nHello,\n\nA product was just {{ verb }}d. Here's what we know:\n\n{{ product | json }}\n\nThanks,\n\n-Mechanic (for {{ shop.name }})\n{% endcapture %}\n\n{\n \"action\": {\n \"type\": \"email\",\n \"options\": {\n \"to\": {{ options.recipient_email__required_email | json }},\n \"subject\": {{ email_subject | json }},\n \"body\": {{ email_body | strip | newline_to_br | json }},\n \"from_display_name\": {{ shop.name | json }}\n }\n }\n}",
"subscriptions": [
"shopify/products/create",
"shopify/products/delete",
"shopify/products/update"
],
"subscriptions_template": "shopify/products/create\nshopify/products/delete\nshopify/products/update",
"tags": [
"Alert",
"Email",
"Products"
]
}