تذكيرات تلقائية بالفواتير المتأخرة

كل صباح، يصل العملاء أصحاب الفواتير المتأخرة تذكير مهذب بالبريد.

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

تعمل مع n8n · Make · Zapier

كيف تعمل

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

المخطط

Weekdays 9:00Schedule TriggerGRead invoicesGoogle Sheets{ }Find overdueCodeGSend reminderGmail
مشغّل تطبيق كود

الكود

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

Find overdue · عقدة Code
// Invoices sheet columns: invoice | client | email | amount | due_date | status
// Keeps unpaid invoices that are past their due date.
const DAY = 24 * 60 * 60 * 1000;
const today = new Date();
today.setHours(0, 0, 0, 0);

return $input.all()
  .map((item) => item.json)
  .filter((r) => r.email && String(r.status).toLowerCase() !== "paid" && new Date(r.due_date) < today)
  .map((r) => ({
    json: { ...r, days_late: Math.floor((today - new Date(r.due_date)) / DAY) },
  }));

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

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

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

ملف Workflow JSON
عرض الكود (139 سطر)
{
  "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": "329e24cb-bac4-44a3-ab91-22f1786e75ae",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 9 * * 1-5"
            }
          ]
        }
      },
      "id": "329e24cb-bac4-44a3-ab91-22f1786e75ae",
      "name": "Weekdays 9:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "operation": "read",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Invoices",
          "mode": "name"
        },
        "options": {}
      },
      "id": "329e24cb-bac4-44a3-ab91-22f1786e75ae",
      "name": "Read invoices",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        300,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// Invoices sheet columns: invoice | client | email | amount | due_date | status\n// Keeps unpaid invoices that are past their due date.\nconst DAY = 24 * 60 * 60 * 1000;\nconst today = new Date();\ntoday.setHours(0, 0, 0, 0);\n\nreturn $input.all()\n  .map((item) => item.json)\n  .filter((r) => r.email && String(r.status).toLowerCase() !== \"paid\" && new Date(r.due_date) < today)\n  .map((r) => ({\n    json: { ...r, days_late: Math.floor((today - new Date(r.due_date)) / DAY) },\n  }));"
      },
      "id": "329e24cb-bac4-44a3-ab91-22f1786e75ae",
      "name": "Find overdue",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        600,
        0
      ]
    },
    {
      "parameters": {
        "sendTo": "={{ $json.email }}",
        "subject": "=Friendly reminder: invoice {{ $json.invoice }}",
        "emailType": "text",
        "message": "=Hi {{ $json.client }},\n\nJust a friendly reminder that invoice {{ $json.invoice }} for {{ $json.amount }} was due {{ $json.days_late }} day(s) ago. If you've already paid, please ignore this email.\n\nThank you!\nYOUR_NAME",
        "options": {
          "appendAttribution": false
        }
      },
      "id": "329e24cb-bac4-44a3-ab91-22f1786e75ae",
      "name": "Send reminder",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        900,
        0
      ]
    }
  ],
  "connections": {
    "Weekdays 9:00": {
      "main": [
        [
          {
            "node": "Read invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read invoices": {
      "main": [
        [
          {
            "node": "Find overdue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find overdue": {
      "main": [
        [
          {
            "node": "Send reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

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

نصائح

  • علّم الفاتورة "paid" في الجدول فتتوقف التذكيرات تلقائيًا.
  • أضف خطوة لإرسال التذكير مرة واحدة أسبوعيًا كحد أقصى لكل فاتورة.

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