Reads the mail that arrived in the window you set and emails you one digest of what matters and what needs doing.

UsesGmailOpenAI

Inbox digest with your next actions

Every day at 07:30, the mail that arrived in your inbox during the window you choose is read and turned into one digest email. AI writes two short sections from it: what matters, grouping related messages and naming the sender, and what needs doing, one line per task, each starting with a verb and naming who it came from.

You get a single email whose subject says how many messages it covers. A quiet inbox still gets a digest saying nothing arrived, so you always know the run happened and there is genuinely nothing waiting. A message without a readable sender, subject or preview is left out and counted at the foot of the digest rather than stopping the run, and if the summary cannot be written the digest still arrives carrying the plain list of what came in.

Nothing needs to exist beforehand beyond your Gmail account and the address the digest should go to. A second copy with an evening time and a shorter window gives you a second digest covering the day.

Run every day at 07:30.Run every day at 07:30.
Set digestTo to blank.Set digestTo to blank.
Set digestTitle to “Morning inbox digest”.Set digestTitle to “Morning inbox digest”.
Set mailWindow to “newer_than:1d”.Set mailWindow to “newer_than:1d”.
Set windowLabel to “since this time yesterday”.Set windowLabel to “since this time yesterday”.
Set maxEmails to 40.Set maxEmails to 40.
GmailGmailList emails matching mailWindow. Save it as mail.List emails matching mailWindow. Save it as mail.
Set messages to mail.emails.Set messages to mail.emails.
Set lines to an empty list.Set lines to an empty list.
Set skipped to 0.Set skipped to 0.
For each email in messages:For each email in messages:
If a step below fails, save the error as unreadableIf a step below fails, save the error as unreadable
Try
Trim email.from and save it as sender.Trim email.from and save it as sender.
Trim email.subject and save it as subject.Trim email.subject and save it as subject.
Trim email.snippet and save it as preview.Trim email.snippet and save it as preview.
Add - From sender | subject | preview to the end of lines and save it as lines.Add - From sender | subject | preview to the end of lines and save it as lines.
On error
Add 1 to skipped.Add 1 to skipped.
Show in the output: Left a message out of the digest: unreadable as text.Show in the output: Left a message out of the digest: unreadable as text.
Count the items in lines and save it as mailCount.Count the items in lines and save it as mailCount.
Join lines with a new line and save it as mailList.Join lines with a new line and save it as mailList.
Set subjectLine to blank.Set subjectLine to blank.
Set digestBody to blank.Set digestBody to blank.
If mailCount is 0If mailCount is 0
Yes
Change subjectLine to “@digestTitle - nothing new”.Change subjectLine to “@digestTitle - nothing new”.
If skipped is greater than 0If skipped is greater than 0
Yes
Change digestBody to “Nothing could be read windowLabel, so there is nothing to summarize.”.Change digestBody to “Nothing could be read windowLabel, so there is nothing to summarize.”.
No
Change digestBody to “Nothing arrived windowLabel. Your inbox is clear and there is nothing waiting on you.”.Change digestBody to “Nothing arrived windowLabel. Your inbox is clear and there is nothing waiting on you.”.
No
Change subjectLine to “@digestTitle - mailCount to read”.Change subjectLine to “@digestTitle - mailCount to read”.
If a step below fails, save the error as summaryErrorIf a step below fails, save the error as summaryError
Try
OpenAIOpenAIAsk OpenAI: 'You are writing one short inbox digest for the person whose mail is listed below. Use only these messages.Ask OpenAI: 'You are writing one short inbox digest for the person whose mail is listed below. Use only these messages. Write exactly two sections, in this order, and nothing else. What matters Up to five short lines. Group related messages together, name the sender, and say in one line why it is worth knowing. What needs doing One line per thing this person has to do, decide or reply to. Start each line with a verb and name the sender it came from. If none of these messages needs anything from them, write the single line: Nothing needs doing. Keep the whole digest under 200 words. Plain text only - no headings, no markdown, no preamble. Messages: mailList'. Save it as answer.
Trim answer.response_text and save it as digestBody.Trim answer.response_text and save it as digestBody.
On error
Show in the output: The summary step did not run: summaryError as text.Show in the output: The summary step did not run: summaryError as text.
If digestBody is emptyIf digestBody is empty
Yes
Change digestBody to A summary could not be produced this time, so here is everything that arrived.Change digestBody to A summary could not be produced this time, so here is everything that arrived. mailList.
No
No steps
Set skippedNote to blank.Set skippedNote to blank.
If skipped is greater than 0If skipped is greater than 0
Yes
Change skippedNote to Change skippedNote to Left out skipped message(s) that arrived without a readable sender, subject or preview.
No
No steps
Set fullBody to digestTitleSet fullBody to digestTitle Covering windowLabel. Messages in this digest: mailCount digestBody@skippedNote.
GmailGmailSend an email to digestTo.Send an email to digestTo. Subject: subjectLinefullBody