[ { "version": 1, "label": "Send a coupon code to a customer when a refund is processed", "trigger_type": [ "refund_created" ], "object_type": "refund", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": [ { "conditions": [ { "field": "refund.order.email", "settings": { "operator": "not_empty", "value": "" }, "weight": 999 }, { "field": "refund.order.customer.first_name", "settings": { "operator": "not_empty", "value": "" }, "weight": 999 } ], "actions": [ { "type": "email", "settings": { "token_object_type": "refund", "to": "{{ refund.order.email }}", "cc": "", "bcc": "", "reply_to": "", "subject": "{{ refund.order.customer.first_name }} - Your refund has been processed", "plain_text": "0", "body": "
Dear {{ refund.order.customer.display_name }},<\/p>\r\n\r\n
\r\nWe have finished processing your refund of \r\n{{ format_money(shop, refund.total_refund_amount) }}<\/strong>.\r\n
\r\nWe apologize for any inconvenience, and here's a coupon code for you to use during your next visit:\r\n<\/p>\r\n\r\n