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

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

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

تعمل مع n8n · Make · Zapier

كيف تعمل

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

المخطط

trueSalla abandoned cartWebhook{ }Read cartCode⑂Has phone and link?IfWSend cart reminderWhatsApp Business CloudGLog reminderGoogle Sheets
مشغّل تطبيق منطق كود

الكود

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

Read cart · عقدة Code
// Mode: Run Once for Each Item
// Salla abandoned.cart webhook → clean fields for the WhatsApp reminder.
// Run one test cart first and check the field names in the webhook data.
const o = $json.body?.data || {};
const c = o.customer || {};

return {
  json: {
    cart_id: o.id,
    name: c.name || [c.first_name, c.last_name].filter(Boolean).join(" "),
    phone: `${c.mobile_code || ""}${c.mobile || ""}`.replace(/[^0-9]/g, ""),
    total: `${o.total?.amount ?? ""} ${o.total?.currency ?? ""}`.trim(),
    url: o.checkout_url || "",
  },
};

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

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

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

ملف Workflow JSON
عرض الكود (209 سطر)
{
  "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": "4582ffa0-b14a-4d3f-a4ae-9194c18933a0",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "salla-abandoned-cart",
        "options": {}
      },
      "id": "4582ffa0-b14a-4d3f-a4ae-9194c18933a0",
      "name": "Salla abandoned cart",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "webhookId": "4582ffa0-b14a-4d3f-a4ae-9194c18933a0"
    },
    {
      "parameters": {
        "jsCode": "// Mode: Run Once for Each Item\n// Salla abandoned.cart webhook → clean fields for the WhatsApp reminder.\n// Run one test cart first and check the field names in the webhook data.\nconst o = $json.body?.data || {};\nconst c = o.customer || {};\n\nreturn {\n  json: {\n    cart_id: o.id,\n    name: c.name || [c.first_name, c.last_name].filter(Boolean).join(\" \"),\n    phone: `${c.mobile_code || \"\"}${c.mobile || \"\"}`.replace(/[^0-9]/g, \"\"),\n    total: `${o.total?.amount ?? \"\"} ${o.total?.currency ?? \"\"}`.trim(),\n    url: o.checkout_url || \"\",\n  },\n};",
        "mode": "runOnceForEachItem"
      },
      "id": "4582ffa0-b14a-4d3f-a4ae-9194c18933a0",
      "name": "Read cart",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        300,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "c1",
              "leftValue": "={{ $json.phone.length >= 10 && $json.url !== '' }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "4582ffa0-b14a-4d3f-a4ae-9194c18933a0",
      "name": "Has phone and link?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.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": "4582ffa0-b14a-4d3f-a4ae-9194c18933a0",
      "name": "Send cart reminder",
      "type": "n8n-nodes-base.whatsApp",
      "typeVersion": 1,
      "position": [
        900,
        0
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Cart reminders",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "date": "={{ $now.toISO() }}",
            "cart_id": "={{ $('Read cart').item.json.cart_id }}",
            "phone": "={{ $('Read cart').item.json.phone }}",
            "total": "={{ $('Read cart').item.json.total }}"
          }
        },
        "options": {}
      },
      "id": "4582ffa0-b14a-4d3f-a4ae-9194c18933a0",
      "name": "Log reminder",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1200,
        0
      ]
    }
  ],
  "connections": {
    "Salla abandoned cart": {
      "main": [
        [
          {
            "node": "Read cart",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read cart": {
      "main": [
        [
          {
            "node": "Has phone and link?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has phone and link?": {
      "main": [
        [
          {
            "node": "Send cart reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send cart reminder": {
      "main": [
        [
          {
            "node": "Log reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

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

نصائح

  • راسل فقط العملاء الذين وافقوا على رسائل واتساب.
  • سلة قد ترسل تذكير SMS خاصًا بها؛ أوقف أحدهما حتى لا يصل العميل تذكيران.

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