احفظ مرفقات البريد في Dropbox

مرفقات الرسائل الواردة تُحفظ تلقائيًا في Dropbox.

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

تعمل مع n8n · Make · Zapier

كيف تعمل

المشغّل: Gmail — بريد جديد بمرفق
  1. راقب Gmail للرسائل التي تحتوي مرفقات.
  2. أعطِ كل ملف اسمًا مؤرخًا.
  3. ارفعه إلى مجلد في Dropbox.

المخطط

GEmail with attachme…Gmail Trigger{ }Split attachmentsCodeDUpload to DropboxDropbox
مشغّل تطبيق كود

الكود

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

Split attachments · عقدة Code
// Splits every attachment into its own item and gives it a sortable file name:
// 2026-09-26-supplier.com-invoice.pdf
const out = [];

for (const item of $input.all()) {
  const date = new Date(item.json.date).toISOString().slice(0, 10);
  const sender = item.json.from?.value?.[0]?.address || "unknown@unknown";
  const domain = sender.split("@")[1];

  for (const file of Object.values(item.binary || {})) {
    out.push({
      json: { fileName: `${date}-${domain}-${file.fileName}` },
      binary: { data: file },
    });
  }
}

return out;

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

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

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

ملف Workflow JSON
عرض الكود (107 سطر)
{
  "name": "احفظ مرفقات البريد في Dropbox (Flowngn)",
  "nodes": [
    {
      "parameters": {
        "content": "## احفظ مرفقات البريد في Dropbox\nمرفقات الرسائل الواردة تُحفظ تلقائيًا في Dropbox.\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": "22e0658a-6dcb-4de5-a18f-ec87e4a044c1",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyHour"
            }
          ]
        },
        "simple": false,
        "filters": {
          "q": "has:attachment"
        },
        "options": {
          "downloadAttachments": true
        }
      },
      "id": "22e0658a-6dcb-4de5-a18f-ec87e4a044c1",
      "name": "Email with attachment",
      "type": "n8n-nodes-base.gmailTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// Splits every attachment into its own item and gives it a sortable file name:\n// 2026-09-26-supplier.com-invoice.pdf\nconst out = [];\n\nfor (const item of $input.all()) {\n  const date = new Date(item.json.date).toISOString().slice(0, 10);\n  const sender = item.json.from?.value?.[0]?.address || \"unknown@unknown\";\n  const domain = sender.split(\"@\")[1];\n\n  for (const file of Object.values(item.binary || {})) {\n    out.push({\n      json: { fileName: `${date}-${domain}-${file.fileName}` },\n      binary: { data: file },\n    });\n  }\n}\n\nreturn out;"
      },
      "id": "22e0658a-6dcb-4de5-a18f-ec87e4a044c1",
      "name": "Split attachments",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        300,
        0
      ]
    },
    {
      "parameters": {
        "operation": "upload",
        "path": "=/Email attachments/{{ $json.fileName }}",
        "binaryData": true,
        "binaryPropertyName": "data"
      },
      "id": "22e0658a-6dcb-4de5-a18f-ec87e4a044c1",
      "name": "Upload to Dropbox",
      "type": "n8n-nodes-base.dropbox",
      "typeVersion": 1,
      "position": [
        600,
        0
      ]
    }
  ],
  "connections": {
    "Email with attachment": {
      "main": [
        [
          {
            "node": "Split attachments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split attachments": {
      "main": [
        [
          {
            "node": "Upload to Dropbox",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

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

نصائح

  • حدّد البحث (مثل from:accounting@) لتحفظ الملفات المفيدة فقط.

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