[ { "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

\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>", "wait": "0", "cw_timezone": "America\/New_York", "custom_wait": "", "run_once": 0 }, "weight": 999, "target_key": null } ] } ], "shared_workflow_id": 244 }, "description": "This workflow is automatically triggered when a refund is created. It checks if the customer's email is available and sends a coupon code via email to the customer. You will be required to edit the email body and add the coupon code in the workflow." } ]