Tags: Costs, Email, Metafields, Price, Products, Variants
This task watches for product and inventory item updates, and sends an email to the configured recipients for each variant that's found to have a unit cost that's greater than the variant's for-sale price.
- View in the task library: tasks.mechanic.dev/send-an-email-when-a-products-price-goes-below-its-cost
- Task JSON, for direct import: task.json
- Preview task code: script.liquid
{
"recipient_emails__array_required": null
}
Learn about task options in Mechanic
shopify/products/update
shopify/inventory_items/update+15.seconds
Learn about event subscriptions in Mechanic
This task watches for product and inventory item updates, and sends an email to the configured recipients for each variant that's found to have a unit cost that's greater than the variant's for-sale price.
This task stores the known price and cost for each variant in a metafield, so subsequent updates to a product or inventory item will only fire this notification if those values change.
Note: the invetory item update subscription is purposely delayed by 15 seconds to prevent sending a duplicate email when both a variant's price and cost are updated at the same time.
YouTube: Watch the development vide for the original task
Find this task in the library at tasks.mechanic.dev, and use the "Try this task" button. Or, import this task's JSON export – see Importing and exporting tasks to learn how imports work.
Found a bug? Got an improvement to add? Start here: ../../CONTRIBUTING.md.
Submit your task requests for consideration by the Mechanic community, and they may be chosen for development and inclusion in the task library!