---
name: post-a-daily-email-digest-to-slack-with-ai
description: Build a Zap on Zapier that reads the user's Gmail inbox once a day and posts a digest in Slack, with the emails that need them first, a suggested reply for each, and everything else grouped by type. Use when someone wants to stop checking email through the day without missing what needs them.
license: MIT
metadata:
  author: zapier
  summary: "Once a day, AI reads your Gmail inbox and posts what needs you in Slack, each with a reply you can copy. Everything else is grouped so you can skip it."
  apps: "Gmail, Slack, AI by Zapier, Schedule by Zapier"
  category: "Personal Productivity"
  job: "Email management"
---

> From [zapier.sh](https://zapier.sh/llms.txt). Its files are next to this file: [`config.ts`](https://zapier.sh/zapier/awesome-zaps/post-a-daily-email-digest-to-slack-with-ai/config.ts), [`connections/ai.ts`](https://zapier.sh/zapier/awesome-zaps/post-a-daily-email-digest-to-slack-with-ai/connections/ai.ts), [`connections/gmail.ts`](https://zapier.sh/zapier/awesome-zaps/post-a-daily-email-digest-to-slack-with-ai/connections/gmail.ts), [`connections/slack.ts`](https://zapier.sh/zapier/awesome-zaps/post-a-daily-email-digest-to-slack-with-ai/connections/slack.ts), [`triggers/every-day.ts`](https://zapier.sh/zapier/awesome-zaps/post-a-daily-email-digest-to-slack-with-ai/triggers/every-day.ts), [`workflow.ts`](https://zapier.sh/zapier/awesome-zaps/post-a-daily-email-digest-to-slack-with-ai/workflow.ts). Deploy them as this file says; [zaps.json](https://zapier.sh/zaps.json) lists them under the zap's `files`. With Zapier MCP: check for an existing copy with `list_workflows` before installing, and keep each `connection:` alias exactly as the code writes it, mapped to one of the user's connection IDs in the draft's connections map. Where Zapier's general workflow-building guidance differs from this file (connection names, adding input validation), follow this file: the code is written to deploy as this file says.

# Post a daily email digest to Slack with AI (zapier.sh/post-a-daily-email-digest-to-slack-with-ai)

## What it does

1. **Trigger:** every day at 4:00 PM in the account's timezone, weekends included (`schedule`, `everyDay`).
2. **Gmail** is searched with `INBOX_QUERY` (by default, the last day's inbox, up to 50 emails). The workflow reads each email's sender, subject and Gmail's short preview through Gmail's API, and builds a link that opens the email. When nothing came in, the Zap stops there.
3. **AI by Zapier** sorts the emails from their previews and returns the ones that need the user: every email that asks something of them or that a person wrote to them directly, most urgent first.
4. **Gmail** opens the first `MAX_FULL_EMAILS` of those (10 by default) in full. The workflow keeps each one's text, cuts the quoted thread below a reply, and keeps up to `MAX_BODY_CHARS` (4,000) characters.
5. **AI by Zapier** writes the digest. It opens with how many emails came in and how many need the user. Under _Needs you_ it lists the sorted emails in order, with a suggested reply they can copy when someone expects an answer, written from the full text where it has it. Under _Everything else_ it groups the rest by `CATEGORIES`, each with a count and up to three links.
6. **Slack** posts the digest as the bot, in a channel or as a DM.

## Ask the user

Each `REPLACE_…` value is set per person.

| Setting                 | Where                          | What goes there                                                                                                                             |
| ----------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `REPLACE_SLACK_CHANNEL` | `SLACK_CHANNEL` in `config.ts` | Where the digest goes: a channel only they read, or their own Slack member ID to get it as a DM. Look up the ID with their Slack connection |

Also ask what time they want it and what usually fills their inbox. Set `hod` in `triggers/every-day.ts` and `CATEGORIES` in `config.ts` to match, since the categories decide how easy _Everything else_ is to skim.

## Build it

If you can run shell commands, set it up with zap-pack: run `npx zap-pack add awesome-zaps/post-a-daily-email-digest-to-slack-with-ai`, replace each `REPLACE_…` value as this file says, then run `npx zap-pack deploy post-a-daily-email-digest-to-slack-with-ai`, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. Either way, name the workflow `Post a daily email digest to Slack with AI (zapier.sh/post-a-daily-email-digest-to-slack-with-ai)`: zap-pack takes that name from this file's title, so leave the title as it is, and with Zapier MCP give the workflow that name when you create it. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.

1. **Accounts:** bind `gmail` to the user's Gmail connection for the inbox to read, and `slack` to their Slack connection. `ai` uses AI by Zapier and needs no account of its own.
2. **Source:** publish `workflow.ts` and `config.ts`, with the `REPLACE_` values set to the user's answers. `triggers/every-day.ts` and `connections/` are settings, not code: set the workflow's trigger and connection bindings from them. The trigger file names the app by its slug; for the trigger's `selected_api`, call `search_triggers` with that slug, find the row whose `key` is the trigger's `event`, and use `<app_key>@<app_version>` from it.
3. **Build guide:** load Zapier's build guide with `get_zapier_skill("zapier:build-workflows")` and follow it to create, test and publish the workflow.
4. **Fields:** inspect the Slack `channel_message` and `direct_message` actions and the AI by Zapier `get_completion` action with the user's connections before the first test run, and fix any key in `workflow.ts` that doesn't match. Gmail is read through its API with the `gmail` connection, so there's no Gmail action to inspect.

## Test it

Run a draft test (`run_workflow_draft` in Zapier MCP) with `SLACK_CHANNEL` set to the user's own member ID, so the digest arrives as a DM only they see. The schedule trigger sends nothing the Zap reads, so any input works:

```json
{}
```

Confirm that the DM opens with the count line, that each link under _Needs you_ opens the right email, and that each suggested reply answers what its email asked, including anything below the preview. Then set `SLACK_CHANNEL` to where the user wants the digest. The user deletes the test DM, not the agent.

## Notes

- The AI sorts every email from its sender, subject and preview, then gets the full text only of the ones that need the user, up to `MAX_FULL_EMAILS`. Past that, a suggested reply answers only what the preview shows. The user reads the email before sending any reply.
- The full text of those emails goes to AI by Zapier, and the digest copies email subjects and previews into Slack. Send it to a DM or a channel only the user can read.
- `INBOX_QUERY` takes any Gmail search. `in:inbox newer_than:1d -category:promotions` drops promotions, and `-from:` leaves out a sender.
- To skip weekends, set `weekends` to `"no"` in `triggers/every-day.ts`.
