Created
December 14, 2023 12:44
-
-
Save cloudhooks/2a3f27e455151cd28a3bc63d44114fa2 to your computer and use it in GitHub Desktop.
Use this hook as a reminder to personally thank a customer who has made a big purchase.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = async (order, actions, { shopifyDomain }) => { | |
// Adjust these variables to customize | |
const minimumPurchase = 100 // in dollars | |
const tag = 'big-spender' | |
const to = '[email protected]' | |
const subject = `(${shopifyDomain}) Large order created` | |
const body = ` | |
${order.customer.email} just made a large order of $${order.total_price}. | |
Maybe you want to thank them personally? | |
Order: ${order.order_id} | |
` | |
if (parseInt(order.total_price) > minimumPurchase) { | |
await actions.shopify.tagCustomer(order.customer.id, tag) | |
await actions.email.send({ to, subject, body }) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment