How to Email Yourself a Daily Summary of Unread Gmail Messages

Date
Created
May 17, 2025 07:36 AM
Tags
gmail
apps-script
notion image
We all get too many emails. Some are important, most are not. But in the chaos of our inboxes, it's easy to miss the messages that matter
 
Wouldn’t it be nice to get one clean summary email every morning listing all your unread messages — with subject lines and senders — so you can quickly decide what to read and what to ignore?
In this tutorial, I’ll show you how to set that up using Google Apps Script. No third-party tools. No need to give access to your inbox. Just a small script, written by you, running inside your Google account.
Let’s get started.

✨ What This Script Will Do

  • Search your Gmail inbox for unread emails.
  • Extract the sender and subject line of each email.
  • Send you a single email with a clean summary list.
Here’s what the summary email will look like:
You have 6 unread emails: 1. "Your Invoice is Ready" — billing@service.com 2. "Meeting Tomorrow at 11am" — boss@company.com 3. "Last Chance: Sale Ends Today" — deals@shop.com ...

🛠 Step 1: Open Google Apps Script

  1. Go to https://script.google.com
  1. Click “New Project”
  1. Rename it to something like: Gmail Daily Summary

🧠 Step 2: Copy and Paste the Script

In the code editor, delete everything and paste this:
function sendUnreadEmailSummary() { const threads = GmailApp.search('is:unread'); if (threads.length === 0) return; let summary = `You have ${threads.length} unread emails:\n\n`; threads.forEach((thread, index) => { const message = thread.getMessages()[0]; const subject = message.getSubject(); const sender = message.getFrom(); summary += `${index + 1}. "${subject}" — ${sender}\n`; }); // Send the summary to yourself MailApp.sendEmail({ to: Session.getActiveUser().getEmail(), subject: "📬 Daily Unread Email Summary", body: summary }); }

✅ Step 3: Save and Run the Script

  1. Click the floppy disk icon 💾 or hit Ctrl+S to save
  1. Click the Run ▶️ button (first time, you'll be asked to grant permission)
  1. Open your inbox — you should receive the summary in seconds!

🔁 Step 4: Automate It Daily

You probably want this summary email every day at, say, 7 AM. Let’s automate that.
  1. In the Apps Script editor, click the clock icon ⏰ on the left (Triggers)
  1. Click “+ Add Trigger”
  1. Set these options:
      • Choose which function to run: sendUnreadEmailSummary
      • Select event source: Time-driven
      • Select type of time-based trigger: Day timer
      • Select time of day: Choose your preferred time (e.g., 7–8 AM)
  1. Click Save
You're done. 🎉

🧹 Optional Cleanup

If you want to:
  • Only show unread emails from the last 24 hours, change the search query to:
const threads = GmailApp.search('is:unread newer_than:1d');
Include a link to the email thread, advanced users can extract the thread.getId() and build URLs like:
https://mail.google.com/mail/u/0/#inbox/<THREAD_ID>

🧘 Final Thoughts

This tiny script gives you big peace of mind.
You no longer have to dig through Gmail. Let the important stuff come to you in a daily briefing—like your own personal email butler.
It’s fast, simple, free, and runs entirely inside your Google account.

💡 What's Next?

  • Want a weekly digest instead of daily? Just change the trigger frequency.
  • Want to forward only unread emails from a specific label or sender? Easy to customize.
  • Want to create a fancy HTML version of the summary? Let me know and I’ll help!