[ { "label": "Notify the store when a customer changes their address", "trigger_type": [ "customer_created", "customer_updated" ], "object_type": "customer", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": { "1": { "conditions": { "1": { "field": "customer.database", "settings": { "multiple": "any", "key": "address", "operator": "empty", "value": "", "token_object_type": "customer", "condition_type": "AND" }, "weight": 999 } }, "actions": { "1": { "type": "customer_set_database", "settings": { "token_object_type": "customer", "key": "address", "value": "{{ format_address(customer.default_address, {format: 'html', country: true, company: false, phone: false}) }}", "wait": "0", "cw_timezone": "America\/New_York", "custom_wait": "" }, "weight": 999, "target_key": "customer" } } }, "2": { "conditions": { "1": { "field": "customer.database", "settings": { "multiple": "any", "key": "address", "operator": "not_empty", "value": "", "token_object_type": "customer", "condition_type": "AND" }, "weight": 999 }, "2": { "field": "customer.database", "settings": { "multiple": "any", "key": "address", "operator": "not_equals", "value": "{{ format_address(customer.default_address, {format: 'html', country: true, company: false, phone: false}) }}", "token_object_type": "customer", "condition_type": "AND" }, "weight": 999 } }, "actions": { "1": { "type": "customer_set_database", "settings": { "token_object_type": "customer", "key": "address", "value": "{{ format_address(customer.default_address, {format: 'html', country: true, company: false, phone: false}) }}", "wait": "0", "cw_timezone": "America\/New_York", "custom_wait": "" }, "weight": 999, "target_key": "customer" }, "2": { "type": "email", "settings": { "token_object_type": "customer", "to": "{{ shop.email }}", "cc": "", "bcc": "", "reply_to": "", "subject": "Customer Address Changed Notice: {{ customer.display_name }}", "plain_text": "1", "body": "Customer ID: {{ customer.id }}\r\nEmail Address: {{ customer.email }}\r\nFull Names: {{ customer.display_name }}\r\nOld Address: {{ customer.database.address }}\r\nNew Address:{{ format_address(customer.default_address, {format: 'html', country: true, company: false, phone: false}) }}", "wait": "0", "cw_timezone": "America\/New_York", "custom_wait": "", "run_once": 0 }, "weight": 1009, "target_key": "customer" } } } }, "shared_workflow_id": 51615 }, "description": "This workflow fires when a customer is created or updated. When a change to the customer's default address is detected, the workflow will send out an email to the store's email address. " } ]