{
  "schema_version": "1.0.0",
  "id": "daily-sales-digest-email",
  "title": "Email a daily digest of Shopify sales",
  "category": "reporting",
  "difficulty": "intermediate",
  "featured": false,
  "description": "Collect every paid Shopify order into one Digest by Zapier entry list and email the day's orders to the owner at 6pm.",
  "tags": [
    "shopify",
    "digest",
    "sales",
    "gmail",
    "daily"
  ],
  "apps": [
    "Shopify",
    "Digest by Zapier",
    "Filter by Zapier",
    "Gmail"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 3 steps after the trigger",
      "Filter by Zapier",
      "premium app: Shopify"
    ]
  },
  "tasks": {
    "typical": 0,
    "max": 1
  },
  "trigger": {
    "app": "Shopify",
    "event": "New Paid Order",
    "kind": "instant",
    "title": "New paid order",
    "why": "Fires for each paid order during the day.",
    "config": {
      "Store": "YOUR_STORE"
    },
    "outputs": [
      "id",
      "order_number",
      "customer_name",
      "total_price",
      "currency",
      "line_item_titles",
      "created_at"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "collect",
      "kind": "digest",
      "app": "Digest by Zapier",
      "event": "Append Entry and Schedule Digest",
      "title": "Add the order to today's digest",
      "why": "Each order becomes one line. The digest releases itself at 6pm.",
      "fields": {
        "Title": "Daily sales",
        "Entry": "#{{trigger.order_number}} · {{trigger.total_price}} {{trigger.currency}} · {{trigger.customer_name}} · {{trigger.line_item_titles}}",
        "Frequency": "Daily",
        "Time of Day": "6pm",
        "Timezone": "YOUR_TIMEZONE"
      },
      "outputs": [
        "entries",
        "entry_count",
        "is_released"
      ]
    },
    {
      "key": "released",
      "kind": "filter",
      "app": "Filter by Zapier",
      "event": "Only continue if...",
      "title": "Only when the digest is released",
      "why": "Zapier holds the run at the digest step until the digest is released, and the released run carries every collected entry. The filter states that rule in the Zap itself, so a copy edited to use \"Release Existing Digest\" elsewhere still only sends once.",
      "conditions": [
        [
          {
            "field": "{{collect.is_released}}",
            "operator": "(Boolean) Is true"
          }
        ]
      ],
      "usually": false
    },
    {
      "key": "send",
      "kind": "action",
      "app": "Gmail",
      "event": "Send Email",
      "title": "Email the day's orders",
      "why": "One email with the order count and every line.",
      "fields": {
        "To": "YOUR_EMAIL",
        "Subject": "Today's sales: {{collect.entry_count}} orders",
        "Body Type": "plain",
        "Body": "{{collect.entry_count}} paid orders today:\n\n{{collect.entries}}\n\nFull details in Shopify admin.",
        "From Name": "Store digest"
      },
      "outputs": [
        "id",
        "thread_id"
      ]
    }
  ]
}
