forked from lightward/mechanic-tasks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomatically-send-account-invite-to-new-customers.json
22 lines (22 loc) · 1.86 KB
/
automatically-send-account-invite-to-new-customers.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"docs": "This task keeps an eye on customers as you create or import them in Shopify, and automatically sends account invitations to any customers that have an email address.\n\nThis task sends account invitations to newly-created customers, whether created/imported through the Shopify admin or through another app. It does not send invitation emails for customers without an email address, or to customers who've signed up via your online store. (Wondering about the 1-minute delay? It's because customers who sign themselves up aren't marked as such until a few seconds after their account is created. So, Mechanic waits a minute, just to be sure.)",
"halt_action_run_sequence_on_error": false,
"name": "Automatically send account invite to new customers",
"online_store_javascript": null,
"options": {
"invitation_email_subject__required": null,
"invitation_email_body__multiline_required": null
},
"order_status_javascript": null,
"perform_action_runs_in_sequence": false,
"script": "{% assign customer = customer.reload %}\n\n{% assign customer_qualifies = false %}\n{% if customer.state == \"disabled\" and customer.email != blank %}\n {% assign customer_qualifies = true %}\n{% endif %}\n\n{% if event.preview or customer_qualifies %}\n {\n \"action\": {\n \"type\": \"shopify\",\n \"options\": [\n \"post\",\n \"/admin/customers/{{ customer.id }}/send_invite.json\",\n {\n \"customer_invite\": {\n \"subject\": {{ options.invitation_email_subject__required | json }},\n \"custom_message\": {{ options.invitation_email_body__multiline_required | json }}\n }\n }\n ]\n }\n }\n{% endif %}",
"subscriptions": [
"shopify/customers/create+1.minute"
],
"subscriptions_template": "shopify/customers/create+1.minute",
"tags": [
"Customers",
"Email",
"Invite"
]
}