أرسل الوحدات الجديدة للمشترين المناسبين على واتساب

عند إضافة وحدة، تصل لكل مشترٍ موافق على التواصل تطابق منطقته ونوعه وميزانيته على واتساب.

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

تعمل مع n8n · Make · Zapier

كيف تعمل

المشغّل: Google Sheets — صف جديد في جدول Listings
  1. أضف وحدة (الكود، المنطقة، النوع، الغرف، السعر، رابط الصور).
  2. اقرأ جدول Buyers.
  3. احتفظ بالمشترين الموافقين الذين تناسبهم المنطقة والنوع والميزانية.
  4. أرسل لكل منهم قالب واتساب بالوحدة.

المخطط

GNew listingGoogle Sheets TriggerGRead buyersGoogle Sheets{ }Matching buyersCodeWSend the listingWhatsApp Business Cloud
مشغّل تطبيق كود

الكود

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

Matching buyers · عقدة Code
// Buyers sheet columns: name | phone | area | type (apartment, villa…) | min_budget | max_budget | opted_in
// Finds opted-in buyers whose area, type and budget fit the new listing.
const listing = $("New listing").first().json;
const price = Number(String(listing.price).replace(/[^0-9.]/g, ""));
const same = (a, b) => String(a || "").trim().toLowerCase() === String(b || "").trim().toLowerCase();

return $input.all()
  .map((item) => item.json)
  .filter((b) => String(b.opted_in).toLowerCase() === "yes" && b.phone)
  .filter((b) => same(b.area, listing.area) && (!b.type || same(b.type, listing.type)))
  .filter((b) => price >= (Number(b.min_budget) || 0) && price <= (Number(b.max_budget) || Infinity))
  .map((b) => ({
    json: {
      phone: String(b.phone).replace(/[^0-9]/g, ""),
      name: b.name,
      code: listing.code,
      summary: `${listing.type} · ${listing.bedrooms} bed · ${listing.area}`,
      price: listing.price,
      link: listing.photos_link || "",
    },
  }));

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

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

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

ملف Workflow JSON
عرض الكود (174 سطر)
{
  "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": "343164f5-4864-4c3c-aba4-cefe1e85c9da",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Listings",
          "mode": "name"
        },
        "event": "rowAdded",
        "options": {}
      },
      "id": "343164f5-4864-4c3c-aba4-cefe1e85c9da",
      "name": "New listing",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "operation": "read",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Buyers",
          "mode": "name"
        },
        "options": {}
      },
      "id": "343164f5-4864-4c3c-aba4-cefe1e85c9da",
      "name": "Read buyers",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        300,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// Buyers sheet columns: name | phone | area | type (apartment, villa…) | min_budget | max_budget | opted_in\n// Finds opted-in buyers whose area, type and budget fit the new listing.\nconst listing = $(\"New listing\").first().json;\nconst price = Number(String(listing.price).replace(/[^0-9.]/g, \"\"));\nconst same = (a, b) => String(a || \"\").trim().toLowerCase() === String(b || \"\").trim().toLowerCase();\n\nreturn $input.all()\n  .map((item) => item.json)\n  .filter((b) => String(b.opted_in).toLowerCase() === \"yes\" && b.phone)\n  .filter((b) => same(b.area, listing.area) && (!b.type || same(b.type, listing.type)))\n  .filter((b) => price >= (Number(b.min_budget) || 0) && price <= (Number(b.max_budget) || Infinity))\n  .map((b) => ({\n    json: {\n      phone: String(b.phone).replace(/[^0-9]/g, \"\"),\n      name: b.name,\n      code: listing.code,\n      summary: `${listing.type} · ${listing.bedrooms} bed · ${listing.area}`,\n      price: listing.price,\n      link: listing.photos_link || \"\",\n    },\n  }));"
      },
      "id": "343164f5-4864-4c3c-aba4-cefe1e85c9da",
      "name": "Matching buyers",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        600,
        0
      ]
    },
    {
      "parameters": {
        "operation": "sendTemplate",
        "phoneNumberId": "YOUR_PHONE_NUMBER_ID",
        "recipientPhoneNumber": "={{ $json.phone }}",
        "template": "YOUR_NEW_LISTING_TEMPLATE|ar",
        "components": {
          "component": [
            {
              "type": "body",
              "bodyParameters": {
                "parameter": [
                  {
                    "type": "text",
                    "text": "={{ $json.name }}"
                  },
                  {
                    "type": "text",
                    "text": "={{ $json.summary }}"
                  },
                  {
                    "type": "text",
                    "text": "={{ $json.price }}"
                  },
                  {
                    "type": "text",
                    "text": "={{ $json.link }}"
                  }
                ]
              }
            }
          ]
        }
      },
      "id": "343164f5-4864-4c3c-aba4-cefe1e85c9da",
      "name": "Send the listing",
      "type": "n8n-nodes-base.whatsApp",
      "typeVersion": 1,
      "position": [
        900,
        0
      ]
    }
  ],
  "connections": {
    "New listing": {
      "main": [
        [
          {
            "node": "Read buyers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read buyers": {
      "main": [
        [
          {
            "node": "Matching buyers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Matching buyers": {
      "main": [
        [
          {
            "node": "Send the listing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

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

نصائح

  • اكتب أسماء المناطق بنفس الطريقة في الجدولين، مثل "New Cairo".

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