[ { "label": "Send a coupon code to a customer when a refund is processed", "trigger_type": "refund_created", "settings": { "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": { "wait": "0", "custom_wait": "", "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

\r\n \r\n [YOUR_COUPON_CODE]\r\n <\/span>\r\n<\/div>\r\n\r\n

\r\nSincerely,\r\nThe {{ shop.name }}<\/a> Team\r\n<\/p>" }, "weight": 999, "target_key": null } ] } ], "shared_workflow_id": 244 } } ]