-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto-tag-customers-with-the-current-date.json
24 lines (24 loc) · 1.67 KB
/
auto-tag-customers-with-the-current-date.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 tag incoming customers with the current date/time, using the format of your choice, and optionally a prefix and suffix. If you like, enable \"Wait until the customer is enabled\" to apply the tag when the customer's online account is activated, rather than when the customer is first created.\r\n\r\nTo customize the date/time format, use an \"strftime\" reference, like [www.strfti.me](http://www.strfti.me/).",
"halt_action_run_sequence_on_error": false,
"name": "Auto-tag new customers with the current date",
"online_store_javascript": null,
"options": {
"tag_date_format__required": "%Y%m%d",
"tag_prefix": "signup-",
"tag_suffix": null,
"wait_until_the_customer_is_enabled__boolean": null
},
"order_status_javascript": null,
"perform_action_runs_in_sequence": false,
"script": "{% assign tag = \"now\" | date: options.tag_date_format__required | prepend: options.tag_prefix | append: options.tag_suffix %}\n\n{% if event.preview %}\n {% assign customer = hash %}\n {% assign customer[\"admin_graphql_api_id\"] = \"gid://shopify/Customer/12345\" %}\n{% endif %}\n\n{% action \"shopify\" %}\n mutation {\n tagsAdd(\n id: {{ customer.admin_graphql_api_id | json }}\n tags: {{ tag | json }}\n ) {\n userErrors {\n field\n message\n }\n }\n }\n{% endaction %}",
"subscriptions": [
"shopify/customers/create",
"shopify/customers/create"
],
"subscriptions_template": "{% if options.wait_until_the_customer_is_enabled__boolean %}\n shopify/customers/enable\n{% else %}\n shopify/customers/create\n{% endif %}\nshopify/customers/create",
"tags": [
"Auto-Tag",
"Customers"
]
}