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.
How it works
- Get today's unread emails, skipping promotions and social.
- Build a list of senders and subjects.
- Send it to Telegram.
Diagram
Code
JavaScript used in the Code step — already included in the template below.
// 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.
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": []
}In Make, create a new scenario and add these modules in order:
- Schedule the scenario: Every day 18:00
- Gmail › Watch Emails (by label)
- Tools › Set variable / Iterator + Array aggregator (same logic as the Code step)
- Telegram Bot › Send a Text Message or a Reply
- Every module run uses Make operations — the free plan includes a monthly quota.
- Make's built-in functions (map, sum, formatDate…) can replace most Code steps; for complex logic use a code module.
- Module and step names can differ slightly as Make and Zapier update their apps.
In Zapier, create a new Zap and add these steps in order:
- Schedule by Zapier — Every day 18:00
- Gmail — New Labeled Email
- Code by Zapier — Run JavaScript (paste the code from the Code section)
- Telegram — Send Message
- Zaps with more than two steps need a paid Zapier plan.
- Webhooks, Filters/Paths and Code by Zapier are premium features on some Zapier plans.
- Code by Zapier runs JavaScript: reuse the code shown above, reading inputs from inputData instead of $json.
- Module and step names can differ slightly as Make and Zapier update their apps.
Tips
- Change the search in the Gmail step, e.g. add -from:noreply to cut notifications.
Related flows
Leave requests approved on Telegram
Employees fill in a leave form; the manager approves or rejects it with one tap on Telegram, and the employee gets an email.
Your daily agenda on Telegram
Every morning, today's calendar events arrive as one neat Telegram message.
AI daily news digest
Every morning, AI summarises the latest articles from a news feed into one short email.