Evening digest of unread emails on Telegram

Every evening, get a list of today's unread emails (sender and subject) on Telegram, so nothing important is missed.

Easy Saves ~2 hours/month ProductivityBy Flowngn team

Works with n8n · Make · Zapier

How it works

Trigger: Schedule — every day at 18:00
  1. Get today's unread emails, skipping promotions and social.
  2. Build a list of senders and subjects.
  3. Send it to Telegram.

Diagram

Every day 18:00Schedule TriggerGGet today's unreadGmail{ }Build digestCodeTSend to TelegramTelegram
Trigger App Code

Code

JavaScript used in the Code step — already included in the template below.

Build digest · Code node
// Lists today's unread emails (sender + subject) as one Telegram message.
const mails = $input.all().map((item) => item.json).filter((m) => m.id);
if (!mails.length) return [{ json: { message: "📭 Inbox zero: no unread emails from today." } }];

const lines = mails.slice(0, 20).map((m) => {
  const from = String(m.From || m.from?.text || "").replace(/<.*>/, "").trim();
  return `• ${from}: ${m.Subject || m.subject || "(no subject)"}`;
});
const more = mails.length > 20 ? `\n…and ${mails.length - 20} more` : "";

return [{ json: { message: `📬 ${mails.length} unread emails today\n\n${lines.join("\n")}${more}` } }];

Build it

Pick your tool — same automation, step by step.

Copy and paste straight into an n8n canvas (Ctrl+V), or download and use Import from File. Then connect your own credentials and replace every YOUR_… placeholder.

Workflow JSON
Show code (130 lines)
{
  "name": "Evening digest of unread emails on Telegram (Flowngn)",
  "nodes": [
    {
      "parameters": {
        "content": "## Evening digest of unread emails on Telegram\nEvery evening, get a list of today's unread emails (sender and subject) on Telegram, so nothing important is missed.\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": "3c103bed-d1db-4cc9-a2c4-9657bf6cad00",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 18
            }
          ]
        }
      },
      "id": "3c103bed-d1db-4cc9-a2c4-9657bf6cad00",
      "name": "Every day 18:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "operation": "getAll",
        "returnAll": true,
        "filters": {
          "q": "is:unread newer_than:1d -category:promotions -category:social"
        }
      },
      "id": "3c103bed-d1db-4cc9-a2c4-9657bf6cad00",
      "name": "Get today's unread",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        300,
        0
      ],
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "jsCode": "// Lists today's unread emails (sender + subject) as one Telegram message.\nconst mails = $input.all().map((item) => item.json).filter((m) => m.id);\nif (!mails.length) return [{ json: { message: \"📭 Inbox zero: no unread emails from today.\" } }];\n\nconst lines = mails.slice(0, 20).map((m) => {\n  const from = String(m.From || m.from?.text || \"\").replace(/<.*>/, \"\").trim();\n  return `• ${from}: ${m.Subject || m.subject || \"(no subject)\"}`;\n});\nconst more = mails.length > 20 ? `\\n…and ${mails.length - 20} more` : \"\";\n\nreturn [{ json: { message: `📬 ${mails.length} unread emails today\\n\\n${lines.join(\"\\n\")}${more}` } }];"
      },
      "id": "3c103bed-d1db-4cc9-a2c4-9657bf6cad00",
      "name": "Build digest",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        600,
        0
      ]
    },
    {
      "parameters": {
        "chatId": "YOUR_CHAT_ID",
        "text": "={{ $json.message }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "id": "3c103bed-d1db-4cc9-a2c4-9657bf6cad00",
      "name": "Send to Telegram",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        900,
        0
      ]
    }
  ],
  "connections": {
    "Every day 18:00": {
      "main": [
        [
          {
            "node": "Get today's unread",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get today's unread": {
      "main": [
        [
          {
            "node": "Build digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build digest": {
      "main": [
        [
          {
            "node": "Send to Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

Open in the playground to edit →

Tips

  • Change the search in the Gmail step, e.g. add -from:noreply to cut notifications.

Related flows