[ { "label": "Text a discount code to a customer after they have placed two orders", "trigger_type": "order_paid", "settings": { "condition_groups": [ { "conditions": [ { "field": "order.customer.orders_count", "settings": { "operator": "gte", "value": "2" }, "weight": 999 }, { "field": "order.customer.accepts_marketing", "settings": { "value": "true" }, "weight": 999 }, { "field": "order.customer.metafields", "settings": { "multiple": "any", "namespace": "arigato", "key": "discount_code_sent", "operator": "empty", "value": "" }, "weight": 999 }, { "field": "order.customer.phone", "settings": { "operator": "not_empty", "value": "" }, "weight": 999 } ], "actions": [ { "type": "sms", "settings": { "wait": "0", "custom_wait": "", "to": "{{ order.customer.phone }}", "body": "Use code [CODE] for 20% off your next order at {{ shop.name }}" }, "weight": 999, "target_key": "order" }, { "type": "customer_set_metafield_value", "settings": { "wait": "0", "custom_wait": "", "namespace": "arigato", "key": "discount_code_sent", "value_type": "integer", "value": "1" }, "weight": 999, "target_key": "order.customer" } ] } ], "shared_workflow_id": 334 } } ]