تنبيهات طلبات سلة الجديدة على تيليجرام

رسالة تيليجرام بالمنتجات والإجمالي والمدينة لكل طلب في سلة.

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

تعمل مع n8n · Make · Zapier

كيف تعمل

المشغّل: Webhook — حدث order.created من سلة
  1. استقبل حدث الطلب الجديد من سلة.
  2. أرسل رقم الطلب والمنتجات والإجمالي ووسيلة الدفع والمدينة إلى تيليجرام.

المخطط

Salla orderWebhook{ }Read Salla orderCodeTNotify on TelegramTelegram
مشغّل تطبيق كود

الكود

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

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

return {
  json: {
    event: body.event,
    order_id: o.reference_id || o.id,
    customer_name: [c.first_name, c.last_name].filter(Boolean).join(" "),
    phone: `${c.mobile_code || ""}${c.mobile || ""}`.replace(/[^0-9]/g, ""),
    email: c.email || "",
    total: o.amounts?.total?.amount ?? o.total?.amount ?? "",
    currency: o.amounts?.total?.currency ?? o.currency ?? "",
    payment_method: o.payment_method || "",
    city: o.shipping?.address?.city || c.city || "",
    items: (o.items || []).map((i) => `${i.quantity}× ${i.name}`).join("، "),
    date: o.date?.date || body.created_at || "",
  },
};

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

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

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

ملف Workflow JSON
عرض الكود (99 سطر)
{
  "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-9194a3a0da24",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "salla-orders-alert",
        "options": {}
      },
      "id": "4582ffa0-b14a-4d3f-a4ae-9194a3a0da24",
      "name": "Salla order",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "webhookId": "4582ffa0-b14a-4d3f-a4ae-9194a3a0da24"
    },
    {
      "parameters": {
        "jsCode": "// Mode: Run Once for Each Item\n// Salla order webhook → clean fields.\n// Run one test order first and check the field names in the webhook data.\nconst body = $json.body || {};\nconst o = body.data || {};\nconst c = o.customer || {};\n\nreturn {\n  json: {\n    event: body.event,\n    order_id: o.reference_id || o.id,\n    customer_name: [c.first_name, c.last_name].filter(Boolean).join(\" \"),\n    phone: `${c.mobile_code || \"\"}${c.mobile || \"\"}`.replace(/[^0-9]/g, \"\"),\n    email: c.email || \"\",\n    total: o.amounts?.total?.amount ?? o.total?.amount ?? \"\",\n    currency: o.amounts?.total?.currency ?? o.currency ?? \"\",\n    payment_method: o.payment_method || \"\",\n    city: o.shipping?.address?.city || c.city || \"\",\n    items: (o.items || []).map((i) => `${i.quantity}× ${i.name}`).join(\"، \"),\n    date: o.date?.date || body.created_at || \"\",\n  },\n};",
        "mode": "runOnceForEachItem"
      },
      "id": "4582ffa0-b14a-4d3f-a4ae-9194a3a0da24",
      "name": "Read Salla order",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        300,
        0
      ]
    },
    {
      "parameters": {
        "chatId": "YOUR_CHAT_ID",
        "text": "=🛍️ طلب جديد #{{ $json.order_id }} — {{ $json.total }} {{ $json.currency }}\n{{ $json.items }}\n👤 {{ $json.customer_name }} · 📍 {{ $json.city || '—' }}\n💳 {{ $json.payment_method }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "id": "4582ffa0-b14a-4d3f-a4ae-9194a3a0da24",
      "name": "Notify on Telegram",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        600,
        0
      ]
    }
  ],
  "connections": {
    "Salla order": {
      "main": [
        [
          {
            "node": "Read Salla order",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Salla order": {
      "main": [
        [
          {
            "node": "Notify on Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

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

نصائح

  • أرسلها إلى مجموعة تيليجرام ليرى فريقك كله الطلبات الجديدة.

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