Every morning, one email with yesterday's Shopify orders, sales and best sellers, and every tracked item running low or sold out.

UsesGmailShopify

Start every day with your Shopify sales and stock

Every morning at 07:00 you get one email about your Shopify store, instead of piecing yesterday together from several admin screens. It leads with yesterday's orders, sales and average order, each compared with the same weekday a week before. Then come the five products that sold the most units, and every tracked item at or below your low-stock level, sold-out items first, so you hear about a sell-out before a customer does.

Yesterday runs from midnight to midnight in your store's own time zone, and test, canceled, voided and fully refunded orders are left out. A day with no orders still gets its email, saying so. If Shopify cannot be read, nothing is sent and the run is marked as failed, so a problem never passes for a quiet day. On a very busy day the product ranking counts the first 100 orders and says so, while the order count and sales always cover every order; an order that cannot be opened for the ranking is named in the email, and the run is marked as failed.

You need Shopify connected with access to orders, products and inventory, a Gmail account to send from, and the email address the brief should go to.

Run every day at 07:00.Run every day at 07:00.
Set recipientEmail to blank.Set recipientEmail to blank.
Set lowStockThreshold to 5.Set lowStockThreshold to 5.
Set maxOrdersForTopProducts to 100.Set maxOrdersForTopProducts to 100.
Trim recipientEmail and save it as sendTo.Trim recipientEmail and save it as sendTo.
If sendTo doesn't contain “@”If sendTo doesn't contain “@”
Yes
Stop and report a problem: '@sendTo' in the 'recipientEmail' step does not look like an email address. Put the address the brief should go to there, such as you@yourstore.com, then run it again.Stop and report a problem: '@sendTo' in the 'recipientEmail' step does not look like an email address. Put the address the brief should go to there, such as you@yourstore.com, then run it again.
No
No steps
Round maxOrdersForTopProducts down and save it as orderCap.Round maxOrdersForTopProducts down and save it as orderCap.
Set store to an empty record.Set store to an empty record.
If a step below fails, save the error as shopErrorIf a step below fails, save the error as shopError
Try
ShopifyShopifyGet your store. Save it as store.Get your store. Save it as store.
On error
Stop and report a problem: Lodol could not read your Shopify store, so no brief was sent. Check under Apps that Shopify is still connected, then run this again. Shopify said: shopError.message.Stop and report a problem: Lodol could not read your Shopify store, so no brief was sent. Check under Apps that Shopify is still connected, then run this again. Shopify said: shopError.message.
Set storeName to store.shop.name.Set storeName to store.shop.name.
Set storeZone to store.shop.ianaTimezone.Set storeZone to store.shop.ianaTimezone.
Set storeCurrency to store.shop.currencyCode.Set storeCurrency to store.shop.currencyCode.
Get yesterday's date and save it as reportDay.Get yesterday's date and save it as reportDay.
Get today's date and save it as today.Get today's date and save it as today.
Get the day of the week for reportDay and save it as dayName.Get the day of the week for reportDay and save it as dayName.
Make reportDay readable as “Monday, November 2” and save it as dayLabel.Make reportDay readable as “Monday, November 2” and save it as dayLabel.
Make reportDay readable as “2026-11-02T14:05:00Z” and save it as dayStart.Make reportDay readable as “2026-11-02T14:05:00Z” and save it as dayStart.
Make today readable as “2026-11-02T14:05:00Z” and save it as dayEnd.Make today readable as “2026-11-02T14:05:00Z” and save it as dayEnd.
Make dayStart readable as “2026-11-02” and save it as searchFrom.Make dayStart readable as “2026-11-02” and save it as searchFrom.
Make dayEnd readable as “2026-11-02” and save it as searchTo.Make dayEnd readable as “2026-11-02” and save it as searchTo.
Get the date 7 days before reportDay and save it as weekBeforeDay.Get the date 7 days before reportDay and save it as weekBeforeDay.
Get the date 6 days before reportDay and save it as weekBeforeNextDay.Get the date 6 days before reportDay and save it as weekBeforeNextDay.
Make weekBeforeDay readable as “2026-11-02T14:05:00Z” and save it as weekBeforeStart.Make weekBeforeDay readable as “2026-11-02T14:05:00Z” and save it as weekBeforeStart.
Make weekBeforeNextDay readable as “2026-11-02T14:05:00Z” and save it as weekBeforeEnd.Make weekBeforeNextDay readable as “2026-11-02T14:05:00Z” and save it as weekBeforeEnd.
Make weekBeforeStart readable as “2026-11-02” and save it as weekBeforeFrom.Make weekBeforeStart readable as “2026-11-02” and save it as weekBeforeFrom.
Make weekBeforeEnd readable as “2026-11-02” and save it as weekBeforeTo.Make weekBeforeEnd readable as “2026-11-02” and save it as weekBeforeTo.
Set dayOrders to an empty list.Set dayOrders to an empty list.
Set orderCursor to blank.Set orderCursor to blank.
Set moreOrderPages to true.Set moreOrderPages to true.
While moreOrderPages is yes:While moreOrderPages is yes:
Set orderPage to an empty record.Set orderPage to an empty record.
If a step below fails, save the error as ordersErrorIf a step below fails, save the error as ordersError
Try
ShopifyShopifyList orders. Save it as orderPage.List orders. Save it as orderPage.
On error
Stop and report a problem: Lodol could not read yesterday's orders from Shopify, so no brief was sent. Shopify said: ordersError.message.Stop and report a problem: Lodol could not read yesterday's orders from Shopify, so no brief was sent. Shopify said: ordersError.message.
Keep each item in orderPage.orders where item.createdAt is greater than or equal to dayStart and item.createdAt is… and save it as pageOrders.Keep each item in orderPage.orders where item.createdAt is greater than or equal to dayStart and item.createdAt is… and save it as pageOrders.
Combine dayOrders and pageOrders into one list and save it as dayOrders.Combine dayOrders and pageOrders into one list and save it as dayOrders.
Change orderCursor to orderPage.next_cursor.Change orderCursor to orderPage.next_cursor.
Change moreOrderPages to orderPage.has_more.Change moreOrderPages to orderPage.has_more.
If orderPage.orders[-1].createdAt is greater than or equal to dayEndIf orderPage.orders[-1].createdAt is greater than or equal to dayEnd
Yes
Change moreOrderPages to false.Change moreOrderPages to false.
No
No steps
Count the items in dayOrders and save it as orderCount.Count the items in dayOrders and save it as orderCount.
Get “totalPriceSet.shopMoney.amount” from every item in dayOrders and save it as orderTotals.Get “totalPriceSet.shopMoney.amount” from every item in dayOrders and save it as orderTotals.
Add up orderTotals and save it as grossSales.Add up orderTotals and save it as grossSales.
Get “totalRefundedSet.shopMoney.amount” from every item in dayOrders and save it as orderRefunds.Get “totalRefundedSet.shopMoney.amount” from every item in dayOrders and save it as orderRefunds.
Add up orderRefunds and save it as refundedSales.Add up orderRefunds and save it as refundedSales.
Set netSales to grossSales minus refundedSales.Set netSales to grossSales minus refundedSales.
Set weekBeforeOrders to an empty list.Set weekBeforeOrders to an empty list.
Set weekBeforeCursor to blank.Set weekBeforeCursor to blank.
Set moreWeekBeforePages to true.Set moreWeekBeforePages to true.
While moreWeekBeforePages is yes:While moreWeekBeforePages is yes:
Set weekBeforePage to an empty record.Set weekBeforePage to an empty record.
If a step below fails, save the error as weekBeforeErrorIf a step below fails, save the error as weekBeforeError
Try
ShopifyShopifyList orders. Save it as weekBeforePage.List orders. Save it as weekBeforePage.
On error
Stop and report a problem: Lodol could not read last week's orders from Shopify for the comparison, so no brief was sent. Shopify said: weekBeforeError.message.Stop and report a problem: Lodol could not read last week's orders from Shopify for the comparison, so no brief was sent. Shopify said: weekBeforeError.message.
Keep each item in weekBeforePage.orders where item.createdAt is greater than or equal to weekBeforeStart and item.createdAt… and save it as weekBeforeMatches.Keep each item in weekBeforePage.orders where item.createdAt is greater than or equal to weekBeforeStart and item.createdAt… and save it as weekBeforeMatches.
Combine weekBeforeOrders and weekBeforeMatches into one list and save it as weekBeforeOrders.Combine weekBeforeOrders and weekBeforeMatches into one list and save it as weekBeforeOrders.
Change weekBeforeCursor to weekBeforePage.next_cursor.Change weekBeforeCursor to weekBeforePage.next_cursor.
Change moreWeekBeforePages to weekBeforePage.has_more.Change moreWeekBeforePages to weekBeforePage.has_more.
If weekBeforePage.orders[-1].createdAt is greater than or equal to weekBeforeEndIf weekBeforePage.orders[-1].createdAt is greater than or equal to weekBeforeEnd
Yes
Change moreWeekBeforePages to false.Change moreWeekBeforePages to false.
No
No steps
Count the items in weekBeforeOrders and save it as weekBeforeCount.Count the items in weekBeforeOrders and save it as weekBeforeCount.
Get “totalPriceSet.shopMoney.amount” from every item in weekBeforeOrders and save it as weekBeforeTotals.Get “totalPriceSet.shopMoney.amount” from every item in weekBeforeOrders and save it as weekBeforeTotals.
Add up weekBeforeTotals and save it as weekBeforeGross.Add up weekBeforeTotals and save it as weekBeforeGross.
Get “totalRefundedSet.shopMoney.amount” from every item in weekBeforeOrders and save it as weekBeforeRefunds.Get “totalRefundedSet.shopMoney.amount” from every item in weekBeforeOrders and save it as weekBeforeRefunds.
Add up weekBeforeRefunds and save it as weekBeforeRefunded.Add up weekBeforeRefunds and save it as weekBeforeRefunded.
Set weekBeforeSales to weekBeforeGross minus weekBeforeRefunded.Set weekBeforeSales to weekBeforeGross minus weekBeforeRefunded.
Round netSales to 2 decimal places and save it as salesRounded.Round netSales to 2 decimal places and save it as salesRounded.
Format salesRounded as a currency and save it as salesText.Format salesRounded as a currency and save it as salesText.
Round weekBeforeSales to 2 decimal places and save it as weekBeforeRounded.Round weekBeforeSales to 2 decimal places and save it as weekBeforeRounded.
Format weekBeforeRounded as a currency and save it as weekBeforeSalesText.Format weekBeforeRounded as a currency and save it as weekBeforeSalesText.
Set averageOrder to 0.Set averageOrder to 0.
If orderCount is greater than 0If orderCount is greater than 0
Yes
Change averageOrder to netSales divided by orderCount.Change averageOrder to netSales divided by orderCount.
No
No steps
Round averageOrder to 2 decimal places and save it as averageRounded.Round averageOrder to 2 decimal places and save it as averageRounded.
Format averageRounded as a currency and save it as averageText.Format averageRounded as a currency and save it as averageText.
Set orderWord to “orders”.Set orderWord to “orders”.
If orderCount is 1If orderCount is 1
Yes
Change orderWord to “order”.Change orderWord to “order”.
No
No steps
Set weekBeforeOrderWord to “orders”.Set weekBeforeOrderWord to “orders”.
If weekBeforeCount is 1If weekBeforeCount is 1
Yes
Change weekBeforeOrderWord to “order”.Change weekBeforeOrderWord to “order”.
No
No steps
Build the text “the same as the @dayName before” and save it as ordersComparison.Build the text “the same as the @dayName before” and save it as ordersComparison.
If orderCount is greater than weekBeforeCountIf orderCount is greater than weekBeforeCount
Yes
Build the text “up from @weekBeforeCount the @dayName before” and save it as ordersComparison.Build the text “up from @weekBeforeCount the @dayName before” and save it as ordersComparison.
Else if @orderCount is less than @weekBeforeCount
Build the text “down from @weekBeforeCount the @dayName before” and save it as ordersComparison.Build the text “down from @weekBeforeCount the @dayName before” and save it as ordersComparison.
Otherwise
No steps
Build the text “the same as the @dayName before” and save it as salesComparison.Build the text “the same as the @dayName before” and save it as salesComparison.
If weekBeforeRounded is less than or equal to 0If weekBeforeRounded is less than or equal to 0
Yes
Build the text “with no sales the @dayName before” and save it as salesComparison.Build the text “with no sales the @dayName before” and save it as salesComparison.
Else if @salesRounded is not @weekBeforeRounded
Set salesChange to salesRounded minus weekBeforeRounded.Set salesChange to salesRounded minus weekBeforeRounded.
Calculate the absolute value of salesChange and save it as salesSwing.Calculate the absolute value of salesChange and save it as salesSwing.
Set swingShare to salesSwing divided by weekBeforeRounded.Set swingShare to salesSwing divided by weekBeforeRounded.
Format swingShare as a percentage with 0 decimal places and save it as swingPercent.Format swingShare as a percentage with 0 decimal places and save it as swingPercent.
Set salesDirection to “up”.Set salesDirection to “up”.
If salesChange is less than 0If salesChange is less than 0
Yes
Change salesDirection to “down”.Change salesDirection to “down”.
No
No steps
Build the text “@salesDirection @swingPercent from @weekBeforeSalesText the @dayName before” and save it as salesComparison.Build the text “@salesDirection @swingPercent from @weekBeforeSalesText the @dayName before” and save it as salesComparison.
Otherwise
No steps
Build the text “Orders: @orderCount, @ordersComparison Sales: @salesText, @salesComparison Average order: @averageText” and save it as salesSection.Build the text “Orders: @orderCount, @ordersComparison Sales: @salesText, @salesComparison Average order: @averageText” and save it as salesSection.
If orderCount is 0 and weekBeforeCount is 0If orderCount is 0 and weekBeforeCount is 0
Yes
Build the text “No orders yesterday, and none the @dayName before either.” and save it as salesSection.Build the text “No orders yesterday, and none the @dayName before either.” and save it as salesSection.
Else if @orderCount is 0
Build the text “No orders yesterday. The @dayName before had @weekBeforeCount @weekBeforeOrderWord and @weekBeforeSalesText in sales.” and save it as salesSection.Build the text “No orders yesterday. The @dayName before had @weekBeforeCount @weekBeforeOrderWord and @weekBeforeSalesText in sales.” and save it as salesSection.
Otherwise
No steps
Take the first orderCap items of dayOrders and save it as ordersToRank.Take the first orderCap items of dayOrders and save it as ordersToRank.
Set soldItems to an empty list.Set soldItems to an empty list.
Set unreadOrders to an empty list.Set unreadOrders to an empty list.
Set lastOrderError to blank.Set lastOrderError to blank.
For each order in ordersToRank:For each order in ordersToRank:
If a step below fails, save the error as orderErrorIf a step below fails, save the error as orderError
Try
ShopifyShopifyGet order. Save it as orderDetail.Get order. Save it as orderDetail.
Combine soldItems and orderDetail.order.lineItems.nodes into one list and save it as soldItems.Combine soldItems and orderDetail.order.lineItems.nodes into one list and save it as soldItems.
On error
Add order.name to the end of unreadOrders and save it as unreadOrders.Add order.name to the end of unreadOrders and save it as unreadOrders.
Change lastOrderError to orderError.message.Change lastOrderError to orderError.message.
Group the items in soldItems by “title”, with the total “quantity” of each and save it as productUnits.Group the items in soldItems by “title”, with the total “quantity” of each and save it as productUnits.
Sort productUnits by total, largest first and save it as rankedProducts.Sort productUnits by total, largest first and save it as rankedProducts.
Take the first 5 items of rankedProducts and save it as topProducts.Take the first 5 items of rankedProducts and save it as topProducts.
Set topProductLines to an empty list.Set topProductLines to an empty list.
Set rank to 0.Set rank to 0.
For each product in topProducts:For each product in topProducts:
Add 1 to rank.Add 1 to rank.
Set unitWord to “units”.Set unitWord to “units”.
If product.total is 1If product.total is 1
Yes
Change unitWord to “unit”.Change unitWord to “unit”.
No
No steps
Add rank. product.key: product.total unitWord to the end of topProductLines and save it as topProductLines.Add rank. product.key: product.total unitWord to the end of topProductLines and save it as topProductLines.
Join topProductLines with a new line and save it as productsSection.Join topProductLines with a new line and save it as productsSection.
If orderCount is 0If orderCount is 0
Yes
Change productsSection to “No orders, so nothing to rank.”.Change productsSection to “No orders, so nothing to rank.”.
Else if @topProducts is empty
Change productsSection to “None of yesterday's orders could be read, so there is no ranking today.”.Change productsSection to “None of yesterday's orders could be read, so there is no ranking today.”.
Otherwise
No steps
Set rankingNote to blank.Set rankingNote to blank.
If orderCount is greater than orderCapIf orderCount is greater than orderCap
Yes
Build the text “(Counted from the first @orderCap of yesterday's @orderCount orders. Raise 'maxOrdersForTopProducts' to count more.)” and save it as rankingNote.Build the text “(Counted from the first @orderCap of yesterday's @orderCount orders. Raise 'maxOrdersForTopProducts' to count more.)” and save it as rankingNote.
No
No steps
Count the items in unreadOrders and save it as unreadCount.Count the items in unreadOrders and save it as unreadCount.
Take the first 10 items of unreadOrders and save it as unreadShown.Take the first 10 items of unreadOrders and save it as unreadShown.
Join unreadShown with “, ” and save it as unreadList.Join unreadShown with “, ” and save it as unreadList.
Set unreadVerb to “are”.Set unreadVerb to “are”.
If unreadCount is 1If unreadCount is 1
Yes
Change unreadVerb to “is”.Change unreadVerb to “is”.
No
No steps
Set unreadMore to blank.Set unreadMore to blank.
If unreadCount is greater than 10If unreadCount is greater than 10
Yes
Join [“ and ”, unreadCount minus 10, “ more”] with nothing and save it as unreadMore.Join [“ and ”, unreadCount minus 10, “ more”] with nothing and save it as unreadMore.
No
No steps
Set unreadNote to blank.Set unreadNote to blank.
If unreadCount is greater than 0If unreadCount is greater than 0
Yes
Build the text “(@unreadCount of yesterday's orders could not be read from Shopify and @unreadVerb left out of this ranking: @unreadList@unreadMore.)” and save it as unreadNote.Build the text “(@unreadCount of yesterday's orders could not be read from Shopify and @unreadVerb left out of this ranking: @unreadList@unreadMore.)” and save it as unreadNote.
No
No steps
Set lowStockItems to an empty list.Set lowStockItems to an empty list.
Set noStockFigure to an empty list.Set noStockFigure to an empty list.
Set stockFigures to an empty list.Set stockFigures to an empty list.
Set variantsChecked to 0.Set variantsChecked to 0.
Set trackedCount to 0.Set trackedCount to 0.
Set variantCursor to blank.Set variantCursor to blank.
Set moreVariantPages to true.Set moreVariantPages to true.
While moreVariantPages is yes:While moreVariantPages is yes:
Set variantPage to an empty record.Set variantPage to an empty record.
If a step below fails, save the error as stockErrorIf a step below fails, save the error as stockError
Try
ShopifyShopifyList product variants. Save it as variantPage.List product variants. Save it as variantPage.
On error
Stop and report a problem: Lodol could not read your stock levels from Shopify, so no brief was sent. Shopify said: stockError.message.Stop and report a problem: Lodol could not read your stock levels from Shopify, so no brief was sent. Shopify said: stockError.message.
Keep each item in variantPage.variants where item.inventoryItem.tracked is yes and save it as pageTracked.Keep each item in variantPage.variants where item.inventoryItem.tracked is yes and save it as pageTracked.
Keep each item in pageTracked where item.product.status is not “DRAFT” and item.product.status is not “ARCHIVED”… and save it as pageLowStock.Keep each item in pageTracked where item.product.status is not “DRAFT” and item.product.status is not “ARCHIVED”… and save it as pageLowStock.
Keep each item in variantPage.variants where item.inventoryItem is empty or item.inventoryItem.tracked is yes and… and save it as pageNoStockFigure.Keep each item in variantPage.variants where item.inventoryItem is empty or item.inventoryItem.tracked is yes and… and save it as pageNoStockFigure.
Combine lowStockItems and pageLowStock into one list and save it as lowStockItems.Combine lowStockItems and pageLowStock into one list and save it as lowStockItems.
Combine noStockFigure and pageNoStockFigure into one list and save it as noStockFigure.Combine noStockFigure and pageNoStockFigure into one list and save it as noStockFigure.
Keep each item in pageTracked where item.inventoryQuantity isn't empty and save it as pageStockFigures.Keep each item in pageTracked where item.inventoryQuantity isn't empty and save it as pageStockFigures.
Combine stockFigures and pageStockFigures into one list and save it as stockFigures.Combine stockFigures and pageStockFigures into one list and save it as stockFigures.
Change variantsChecked to variantsChecked plus variantPage.count.Change variantsChecked to variantsChecked plus variantPage.count.
Count the items in pageTracked and save it as pageTrackedCount.Count the items in pageTracked and save it as pageTrackedCount.
Change trackedCount to trackedCount plus pageTrackedCount.Change trackedCount to trackedCount plus pageTrackedCount.
Change variantCursor to variantPage.next_cursor.Change variantCursor to variantPage.next_cursor.
Change moreVariantPages to variantPage.has_more.Change moreVariantPages to variantPage.has_more.
Count the items in noStockFigure and save it as noStockFigureCount.Count the items in noStockFigure and save it as noStockFigureCount.
If noStockFigureCount is greater than 0 and stockFigures is emptyIf noStockFigureCount is greater than 0 and stockFigures is empty
Yes
Stop and report a problem: Shopify did not report a stock figure for any of your items, so no brief was sent. This usually means the Lodol app in your Shopify admin is missing the read_inventory access scope: add it in the app's Configuration in the Shopify Dev Dashboard, release a new version, install the app on the store again, then run this again.Stop and report a problem: Shopify did not report a stock figure for any of your items, so no brief was sent. This usually means the Lodol app in your Shopify admin is missing the read_inventory access scope: add it in the app's Configuration in the Shopify Dev Dashboard, release a new version, install the app on the store again, then run this again.
No
No steps
Sort lowStockItems by inventoryQuantity, smallest first and save it as sortedLowStock.Sort lowStockItems by inventoryQuantity, smallest first and save it as sortedLowStock.
Keep each item in lowStockItems where item.inventoryQuantity is less than or equal to 0 and save it as outOfStock.Keep each item in lowStockItems where item.inventoryQuantity is less than or equal to 0 and save it as outOfStock.
Count the items in outOfStock and save it as outCount.Count the items in outOfStock and save it as outCount.
Count the items in lowStockItems and save it as lowStockCount.Count the items in lowStockItems and save it as lowStockCount.
Set runningLowCount to lowStockCount minus outCount.Set runningLowCount to lowStockCount minus outCount.
Take the first 40 items of sortedLowStock and save it as stockShown.Take the first 40 items of sortedLowStock and save it as stockShown.
Set stockLines to an empty list.Set stockLines to an empty list.
For each variant in stockShown:For each variant in stockShown:
Set itemName to variant.product.title.Set itemName to variant.product.title.
If variant.title is not “Default Title”If variant.title is not “Default Title”
Yes
Build the text “@variant.product.title - @variant.title” and save it as itemName.Build the text “@variant.product.title - @variant.title” and save it as itemName.
No
No steps
Set skuNote to blank.Set skuNote to blank.
If variant.sku isn't emptyIf variant.sku isn't empty
Yes
Build the text “(SKU @variant.sku)” and save it as skuNote.Build the text “(SKU @variant.sku)” and save it as skuNote.
No
No steps
Build the text “@variant.inventoryQuantity left” and save it as stockNow.Build the text “@variant.inventoryQuantity left” and save it as stockNow.
If variant.inventoryQuantity is less than 0If variant.inventoryQuantity is less than 0
Yes
Calculate the absolute value of variant.inventoryQuantity and save it as oversoldBy.Calculate the absolute value of variant.inventoryQuantity and save it as oversoldBy.
Build the text “out of stock, oversold by @oversoldBy” and save it as stockNow.Build the text “out of stock, oversold by @oversoldBy” and save it as stockNow.
Else if @variant.inventoryQuantity is 0
Change stockNow to “out of stock”.Change stockNow to “out of stock”.
Otherwise
No steps
Add • itemName@skuNote: stockNow to the end of stockLines and save it as stockLines.Add • itemName@skuNote: stockNow to the end of stockLines and save it as stockLines.
Join stockLines with a new line and save it as stockList.Join stockLines with a new line and save it as stockList.
Set stockNotShown to lowStockCount minus 40.Set stockNotShown to lowStockCount minus 40.
Set moreStockNote to blank.Set moreStockNote to blank.
If stockNotShown is greater than 0If stockNotShown is greater than 0
Yes
Build the text “...and @stockNotShown more. Products > Inventory in Shopify lists them all.” and save it as moreStockNote.Build the text “...and @stockNotShown more. Products > Inventory in Shopify lists them all.” and save it as moreStockNote.
No
No steps
Set noStockFigureNote to blank.Set noStockFigureNote to blank.
If noStockFigureCount is greater than 0If noStockFigureCount is greater than 0
Yes
Build the text “(Shopify gave no stock figure for @noStockFigureCount of your items, so they were not checked.)” and save it as noStockFigureNote.Build the text “(Shopify gave no stock figure for @noStockFigureCount of your items, so they were not checked.)” and save it as noStockFigureNote.
No
No steps
Set itemWord to “items”.Set itemWord to “items”.
If lowStockCount is 1If lowStockCount is 1
Yes
Change itemWord to “item”.Change itemWord to “item”.
No
No steps
Build the text “@lowStockCount @itemWord, @outCount of them out of stock” and save it as stockSummary.Build the text “@lowStockCount @itemWord, @outCount of them out of stock” and save it as stockSummary.
If outCount is 0If outCount is 0
Yes
Build the text “@lowStockCount @itemWord running low” and save it as stockSummary.Build the text “@lowStockCount @itemWord running low” and save it as stockSummary.
Else if @outCount is @lowStockCount
Build the text “@lowStockCount @itemWord, all out of stock” and save it as stockSummary.Build the text “@lowStockCount @itemWord, all out of stock” and save it as stockSummary.
If lowStockCount is 1If lowStockCount is 1
Yes
Change stockSummary to “1 item, out of stock”.Change stockSummary to “1 item, out of stock”.
No
No steps
Otherwise
No steps
Build the text “@stockSummary: @stockList@moreStockNote@noStockFigureNote” and save it as stockSection.Build the text “@stockSummary: @stockList@moreStockNote@noStockFigureNote” and save it as stockSection.
If variantsChecked is 0If variantsChecked is 0
Yes
Change stockSection to “Your store has no products yet, so there is no stock to check.”.Change stockSection to “Your store has no products yet, so there is no stock to check.”.
Else if @trackedCount is 0
Build the text “None of your products has 'Track quantity' turned on in Shopify, so there is no stock to check. Turn it on for a product to include it here.@noStockFigureNote” and save it as stockSection.Build the text “None of your products has 'Track quantity' turned on in Shopify, so there is no stock to check. Turn it on for a product to include it here.@noStockFigureNote” and save it as stockSection.
Else if @lowStockCount is 0
Build the text “Every tracked item has more than @lowStockThreshold units in stock.@noStockFigureNote” and save it as stockSection.Build the text “Every tracked item has more than @lowStockThreshold units in stock.@noStockFigureNote” and save it as stockSection.
Otherwise
No steps
Build the text “@orderCount @orderWord, @salesText in sales” and save it as salesHeadline.Build the text “@orderCount @orderWord, @salesText in sales” and save it as salesHeadline.
If orderCount is 0If orderCount is 0
Yes
Change salesHeadline to “no orders”.Change salesHeadline to “no orders”.
No
No steps
Set stockHeadline to blank.Set stockHeadline to blank.
If outCount is greater than 0If outCount is greater than 0
Yes
Build the text “, @outCount out of stock” and save it as stockHeadline.Build the text “, @outCount out of stock” and save it as stockHeadline.
Else if @runningLowCount is greater than 0
Build the text “, @runningLowCount running low” and save it as stockHeadline.Build the text “, @runningLowCount running low” and save it as stockHeadline.
Otherwise
No steps
If a step below fails, save the error as sendErrorIf a step below fails, save the error as sendError
Try
GmailGmailSend an email to sendTo. Save it as sent.Send an email to sendTo. Save it as sent. Subject: dayName at storeName: salesHeadline@stockHeadlineGood morning, Here is how storeName did yesterday, dayLabel. SALES salesSection TOP 5 PRODUCTS BY UNITS ORDERED ...
On error
Stop and report a problem: The brief could not be sent from Gmail, so nobody received it. Check under Apps that Gmail is still connected, then run this again. Gmail said: sendError.message.Stop and report a problem: The brief could not be sent from Gmail, so nobody received it. Check under Apps that Gmail is still connected, then run this again. Gmail said: sendError.message.
If unreadCount is greater than 0If unreadCount is greater than 0
Yes
Stop and report a problem: Sent the brief to sendTo, but unreadCount of yesterday's orders could not be read from Shopify and unreadVerb left out of the top products: unreadList@unreadMore. Shopify said: lastOrderError.Stop and report a problem: Sent the brief to sendTo, but unreadCount of yesterday's orders could not be read from Shopify and unreadVerb left out of the top products: unreadList@unreadMore. Shopify said: lastOrderError.
No
No steps
Finish the run: Sent the brief for dayLabel to sendTo: salesHeadline, outCount out of stock and runningLowCount running low.Finish the run: Sent the brief for dayLabel to sendTo: salesHeadline, outCount out of stock and runningLowCount running low.