Cloudhooks

Thank customers for making a large purchase (Shopify)


Use this hook as a reminder to personally thank a customer who has made a big purchase. Customer will also be tagged, so you can better learn who your "power users" are.

The minimumPurchase variable is useful for setting a dollar amount, over which, you want to be notified about the order.

module.exports = async (order, actions, { shopUrl }) => {

  // Adjust these variables to customize
  const minimumPurchase = 100 // in dollars
  const tag = 'big-spender'
  const to = '[email protected]'
  const subject = `(${shopUrl}) Large order created`
  const body = `<p>
    ${order.customer.email} just made a large order of $${order.total_price}. 
    <br>
    Maybe you want to thank them personally? 
    <br>
    Order: <a href="${shopUrl}/admin/orders/${order.id}">${refund.order_id}</a>
  </p>`

  if (parseInt(order.total_price) > minimumPurchase) {
    await actions.shopify.tagCustomer(order.customer.id, tag)
    await actions.email.send({ to, subject, body })
  }
}
  


Try Cloudhooks on your shop


.myshopify.com