تذكير السلات المتروكة على واتساب

العملاء الذين يتركون صفحة الدفع يصلهم تذكير لطيف على واتساب برابط يعيدهم لسلتهم.

متوسط توفّر ~6 ساعة شهريًا التجارة الإلكترونيةبواسطة فريق Flowngn

تعمل مع n8n · Make · Zapier

كيف تعمل

المشغّل: جدول زمني — كل ساعة
  1. كل ساعة، اجلب من Shopify عمليات الدفع المتروكة منذ 1–2 ساعة.
  2. احتفظ بالتي فيها رقم هاتف ولم تكتمل.
  3. أرسل لكل عميل قالب واتساب معتمدًا بالإجمالي ورابط العودة للسلة.

المخطط

Every hourSchedule TriggerGet abandoned check…HTTP Request{ }Carts with a phoneCodeWSend cart reminderWhatsApp Business Cloud
مشغّل تطبيق كود

الكود

كود JavaScript المستخدم في خطوات Code، وهو مضمَّن بالفعل في القالب بالأسفل.

Carts with a phone · عقدة Code
// Keeps abandoned checkouts from the last hour or two that have a phone number
// and were not completed, ready for a WhatsApp reminder.
const checkouts = $input.first().json.checkouts || [];

return checkouts
  .filter((c) => !c.completed_at)
  .map((c) => ({
    phone: String(c.phone || c.shipping_address?.phone || c.billing_address?.phone || "").replace(/[^0-9]/g, ""),
    name: c.shipping_address?.first_name || c.customer?.first_name || "",
    total: `${c.total_price} ${c.currency}`,
    url: c.abandoned_checkout_url,
  }))
  .filter((c) => c.phone.length >= 10)
  .map((c) => ({ json: c }));

ابنِها بأداتك

اختر أداتك — نفس الأتمتة، خطوة بخطوة.

انسخه والصقه مباشرة في مساحة عمل n8n (Ctrl+V)، أو حمّله واستخدم Import from File. بعد ذلك اربط حساباتك واستبدل كل قيمة تبدأ بـ YOUR_.

ملف Workflow JSON
عرض الكود (151 سطر)
{
  "name": "تذكير السلات المتروكة على واتساب (Flowngn)",
  "nodes": [
    {
      "parameters": {
        "content": "## تذكير السلات المتروكة على واتساب\nالعملاء الذين يتركون صفحة الدفع يصلهم تذكير لطيف على واتساب برابط يعيدهم لسلتهم.\n\n**Setup**\n1. Open each node and connect your own credentials.\n2. Replace every YOUR_… placeholder.\n3. Test once, then activate.\n\nFree template from Flowngn",
        "height": 260,
        "width": 340
      },
      "id": "458210f1-f980-4989-a1ec-07858e8eaece",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 1
            }
          ]
        }
      },
      "id": "458210f1-f980-4989-a1ec-07858e8eaece",
      "name": "Every hour",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "url": "=https://YOUR_STORE.myshopify.com/admin/api/2024-10/checkouts.json?created_at_min={{ $now.minus({ hours: 2 }).toISO() }}&created_at_max={{ $now.minus({ hours: 1 }).toISO() }}",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "shopifyAccessTokenApi",
        "options": {}
      },
      "id": "458210f1-f980-4989-a1ec-07858e8eaece",
      "name": "Get abandoned checkouts",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        300,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// Keeps abandoned checkouts from the last hour or two that have a phone number\n// and were not completed, ready for a WhatsApp reminder.\nconst checkouts = $input.first().json.checkouts || [];\n\nreturn checkouts\n  .filter((c) => !c.completed_at)\n  .map((c) => ({\n    phone: String(c.phone || c.shipping_address?.phone || c.billing_address?.phone || \"\").replace(/[^0-9]/g, \"\"),\n    name: c.shipping_address?.first_name || c.customer?.first_name || \"\",\n    total: `${c.total_price} ${c.currency}`,\n    url: c.abandoned_checkout_url,\n  }))\n  .filter((c) => c.phone.length >= 10)\n  .map((c) => ({ json: c }));"
      },
      "id": "458210f1-f980-4989-a1ec-07858e8eaece",
      "name": "Carts with a phone",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        600,
        0
      ]
    },
    {
      "parameters": {
        "operation": "sendTemplate",
        "phoneNumberId": "YOUR_PHONE_NUMBER_ID",
        "recipientPhoneNumber": "={{ $json.phone }}",
        "template": "YOUR_CART_REMINDER_TEMPLATE|ar",
        "components": {
          "component": [
            {
              "type": "body",
              "bodyParameters": {
                "parameter": [
                  {
                    "type": "text",
                    "text": "={{ $json.name || 'عميلنا العزيز' }}"
                  },
                  {
                    "type": "text",
                    "text": "={{ $json.total }}"
                  },
                  {
                    "type": "text",
                    "text": "={{ $json.url }}"
                  }
                ]
              }
            }
          ]
        }
      },
      "id": "458210f1-f980-4989-a1ec-07858e8eaece",
      "name": "Send cart reminder",
      "type": "n8n-nodes-base.whatsApp",
      "typeVersion": 1,
      "position": [
        900,
        0
      ]
    }
  ],
  "connections": {
    "Every hour": {
      "main": [
        [
          {
            "node": "Get abandoned checkouts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get abandoned checkouts": {
      "main": [
        [
          {
            "node": "Carts with a phone",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Carts with a phone": {
      "main": [
        [
          {
            "node": "Send cart reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

← افتحها في ساحة التجربة لتعديلها

نصائح

  • راسل فقط العملاء الذين وافقوا على رسائل واتساب عند الدفع.
  • كود خصم صغير في القالب غالبًا يضاعف السلات المستعادة.

أتمتات مشابهة