أسبوعك القادم في بريد واحد

كل صباح أحد، يصلك بريد واحد بكل اجتماعات الأسبوع مقسّمة حسب اليوم.

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

تعمل مع n8n · Make · Zapier

كيف تعمل

المشغّل: جدول زمني — كل أحد الساعة 7:00
  1. اجلب أحداث الأيام السبعة القادمة من Google Calendar.
  2. قسّمها حسب اليوم مع مواعيدها.
  3. أرسل النظرة العامة إلى بريدك.

المخطط

Sundays 7:00Schedule TriggerCGet this week's eve…Google Calendar{ }Group by dayCodeGEmail the weekGmail
مشغّل تطبيق كود

الكود

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

Group by day · عقدة Code
// Groups this week's calendar events by day into a short email.
const events = $input.all().map((item) => item.json).filter((e) => e.start);
const byDay = {};

for (const e of events) {
  const start = new Date(e.start.dateTime || e.start.date);
  const day = start.toLocaleDateString("en-GB", { weekday: "long", day: "numeric", month: "short" });
  const time = e.start.dateTime ? start.toTimeString().slice(0, 5) : "All day";
  (byDay[day] ||= []).push(`  ${time}  ${e.summary || "(no title)"}`);
}

const body = Object.keys(byDay).length
  ? Object.entries(byDay).map(([day, items]) => `${day}\n${items.join("\n")}`).join("\n\n")
  : "Nothing on your calendar this week.";

return [{ json: { count: events.length, body } }];

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

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

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

ملف Workflow JSON
عرض الكود (140 سطر)
{
  "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": "3f36aaf0-8bb5-49c1-a1a3-cee797bc05e2",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 7 * * 0"
            }
          ]
        }
      },
      "id": "3f36aaf0-8bb5-49c1-a1a3-cee797bc05e2",
      "name": "Sundays 7:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "operation": "getAll",
        "calendar": {
          "__rl": true,
          "value": "primary",
          "mode": "id"
        },
        "returnAll": true,
        "timeMin": "={{ $today.toISO() }}",
        "timeMax": "={{ $today.plus({ days: 7 }).toISO() }}",
        "options": {
          "singleEvents": true,
          "orderBy": "startTime"
        }
      },
      "id": "3f36aaf0-8bb5-49c1-a1a3-cee797bc05e2",
      "name": "Get this week's events",
      "type": "n8n-nodes-base.googleCalendar",
      "typeVersion": 1.3,
      "position": [
        300,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// Groups this week's calendar events by day into a short email.\nconst events = $input.all().map((item) => item.json).filter((e) => e.start);\nconst byDay = {};\n\nfor (const e of events) {\n  const start = new Date(e.start.dateTime || e.start.date);\n  const day = start.toLocaleDateString(\"en-GB\", { weekday: \"long\", day: \"numeric\", month: \"short\" });\n  const time = e.start.dateTime ? start.toTimeString().slice(0, 5) : \"All day\";\n  (byDay[day] ||= []).push(`  ${time}  ${e.summary || \"(no title)\"}`);\n}\n\nconst body = Object.keys(byDay).length\n  ? Object.entries(byDay).map(([day, items]) => `${day}\\n${items.join(\"\\n\")}`).join(\"\\n\\n\")\n  : \"Nothing on your calendar this week.\";\n\nreturn [{ json: { count: events.length, body } }];"
      },
      "id": "3f36aaf0-8bb5-49c1-a1a3-cee797bc05e2",
      "name": "Group by day",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        600,
        0
      ]
    },
    {
      "parameters": {
        "sendTo": "you@yourcompany.com",
        "subject": "=🗓 Your week: {{ $json.count }} events",
        "emailType": "text",
        "message": "={{ $json.body }}",
        "options": {
          "appendAttribution": false
        }
      },
      "id": "3f36aaf0-8bb5-49c1-a1a3-cee797bc05e2",
      "name": "Email the week",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        900,
        0
      ]
    }
  ],
  "connections": {
    "Sundays 7:00": {
      "main": [
        [
          {
            "node": "Get this week's events",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get this week's events": {
      "main": [
        [
          {
            "node": "Group by day",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Group by day": {
      "main": [
        [
          {
            "node": "Email the week",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

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

نصائح

  • غيّر الجدول إلى الإثنين إذا كان أسبوعك يبدأ يوم الإثنين.

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