[ { "label": "Send me an email when a discount code is used on an order", "trigger_type": [ "order_paid" ], "object_type": "order", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": [ { "conditions": [ { "field": "order.discount_codes.code", "settings": { "multiple": "any", "operator": "not_empty", "value": "", "long_value": "", "token_object_type": "order", "condition_type": "AND" }, "weight": 999 } ], "actions": [ { "type": "email", "settings": { "wait": "0", "custom_wait": "", "to": "{{ shop.email }}", "cc": "", "bcc": "", "reply_to": "", "subject": "Special Discount Code Used", "plain_text": "1", "body": "Hi there,\r\n\r\nThe code(s) {{ order.discount_codes | map('code') | join(\", \") }} was used on order {{ order.name }}\r\n\r\nTotal Discounts: {{ order.total_discounts }}\r\n\r\nProducts Ordered:\r\n{{ order_products_list(order, {format: 'html', link: true, quantity: true}) }}\r\n\r\nAdmin Link: {{ shopify_admin_link(order, {resource: 'orders'}) }}" }, "weight": 999, "target_key": "order" } ] } ], "shared_workflow_id": 337 }, "description": "This workflow is triggered when an order is paid, you can use it to get email alerts when new orders come in that has some applied discount codes. " } ]