[ { "label": "Send new subscribers a discount code", "trigger_type": [ "customer_created", "customer_updated" ], "object_type": "customer", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": [ { "conditions": [ { "field": "customer.accepts_marketing", "settings": { "value": "true", "condition_type": "AND" }, "weight": 999 }, { "field": "customer.tags", "settings": { "operator": "not_contains", "value": "New Sub Discount Sent", "long_value": "", "condition_type": "AND" }, "weight": 999 } ], "actions": [ { "type": "customer_add_tags", "settings": { "wait": "0", "custom_wait": "", "tags": "New Sub Discount Sent" }, "weight": 999, "target_key": "customer" }, { "type": "email", "settings": { "token_object_type": "customer", "to": "{{ customer.email }}", "cc": "", "bcc": "", "reply_to": "", "subject": "{{ shop.name }} Discount Code", "plain_text": "0", "body": "Hi there,\r\n\r\nThank you for subscribing. As a token of our appricaaction, here's a discount code to use on your next order.\r\n\r\nUse: 1234<\/strong>", "wait": "0", "cw_timezone": "Europe\/London", "custom_wait": "", "run_once": 0 }, "weight": 999, "target_key": "customer" } ] } ], "shared_workflow_id": 662 }, "description": "This workflow is triggered when a customer is created or updated and checks if the customer has subscribed to marketing emails. The workflow adds a unique tag and also sends the customer an email containing a pre-defined discount code." } ]