AI Email Summarizer to Slack

Every incoming email to a shared inbox gets summarized by AI into one line and posted to your team Slack channel.

The Snippet

// Zapier Code step — trim an email body to a safe prompt size
// and strip quoted replies before sending to GPT
const body = (inputData.body || "")
  .split(/^On .+ wrote:$/m)[0]      // drop quoted history
  .replace(/<[^>]+>/g, " ")          // strip HTML tags
  .replace(/\s+/g, " ")
  .trim();
output = { prompt: body.slice(0, 6000) };

Implementation Steps

  1. Trigger: New Email in Gmail (shared inbox label)
  2. Add ChatGPT action: 'Summarize this email in one sentence and rate urgency 1-5'
  3. Add a Filter: only continue if urgency >= 3
  4. Add Slack 'Send Channel Message' with summary + urgency
  5. Publish and monitor for one week, tune the prompt

All templates