AI email summaries and automatic reply suggestions
Introduction

In recent years, email has become one of the most overwhelming channels faced by managers, developers, and customer teams alike. Artificial intelligence can simplify the process of reading and replying to emails by automatically summarizing their content and suggesting replies that only need approval. In this article, we will show step by step how to create a functional MVP of such a system – from receiving an email to a reply draft ready for approval.
Project goal

The goal is to create a practical workflow that:
- automatically receives incoming emails,
- converts their content into text format,
- performs summarization using an artificial intelligence model,
- generates a reply draft based on context,
- allows the user to review, edit, and approve the draft,
- and ensures the approved reply is sent.
After completing this process, you will have a genuinely functional prototype that can be further developed into a company assistant tool.
Prerequisites
- An account with Zapier (for workflow orchestration).
- Access to the Gmail API (for reading and sending emails).
- An API key for the OpenAI API (for generating summaries and reply drafts).
- The Gmail mobile app or another client connected to the account being used.
- Basic knowledge of JSON formats and working with REST APIs.
Optionally: Google Sheets can serve well for storing and reviewing test emails. This makes it possible to track results and measure the quality of the drafts.
Recommended AI stack for implementation
Choose tools according to your budget and level of automation. Below is a direct overview of services for implementing the project.
| Tool | Offer |
|---|---|
| NordVPN | Open offer |
| Semrush | Open offer |
| Make | Open offer |
| Hostinger | Open offer |
| Fiverr | Open offer |
| Adobe | Open offer |
| Canva | Open offer |
| Jasper | Open offer |
Implementation steps
Step 1: Connecting the Gmail API
What and why: For the system to read new emails and respond to them, it is necessary to obtain their text content. The Gmail API provides direct access to emails at the message level.
How: In the Google Cloud Console, create a new project, go to the API & Services → Library section, enable the Gmail API, and create an OAuth 2.0 client. Save the client_id and client_secret.
Example API request for loading a new message:
GET https://gmail.googleapis.com/gmail/v1/users/me/messages?q=is:unread
Input: The q parameter with the value is:unread
Output: A JSON object with a list of new message IDs.
Success metric: the system returns at least one unread email ID without a 403 error (insufficient permissions).
Step 2: Retrieving the email body
What and why: To create a summary, you need the email text in a clean form. The Gmail API allows you to decode MIME parts and obtain text without HTML tags.
How: Use the endpoint:
GET https://gmail.googleapis.com/gmail/v1/users/me/messages/{messageId}?format=FULL
Extract the content from payload.parts[].body.data from the response body and decode Base64.
Input: The messageId parameter from the previous step.
Output: The email text content as a clean string field email_text.
Success metric: the entire email is displayed correctly in readable text form.
Step 3: Summarizing the email using OpenAI
What and why: An email summary allows the user to quickly understand what the communication is about without having to read the details.
How: In Zapier, create a new step of type Action → Webhooks by Zapier → Custom Request. Set up a POST request to https://api.openai.com/v1/chat/completions with the following body:
{
"model": "gpt-4-turbo",
"messages": [
{"role": "system", "content": "Summarize the following email in 3 sentences and preserve the key information."},
{"role": "user", "content": "{{email_text}}"}
],
"max_tokens": 200
}
Input: email_text – the email text.
Output: summary_text – the email summary.
Success metric: summary length ≤ 3 sentences, preservation of key data (e.g. deadlines, names, order numbers).
Step 4: Generating a reply draft
What and why: After summarizing the email, we can let AI suggest a concise reply with an appropriate tone and content. This step saves time when writing routine replies.
How: In the next Zapier step, use the OpenAI API again, this time with a different system prompt:
{
"model": "gpt-4-turbo",
"messages": [
{"role": "system", "content": "You are an assistant for business emails. Based on the summary, suggest a concise and positive reply."},
{"role": "user", "content": "{{summary_text}}"}
],
"temperature": 0.7
}
Input: summary_text
Output: draft_reply – a reply draft ready for review.
Success metric: the reply draft accurately captures the topic of the email and formally matches the company style (e.g. no informal expressions in B2B communication).
Step 5: Approving or editing the reply
What and why: AI drafts should always be reviewed by a human. Automatic sending without validation can be risky due to unintended misunderstandings.
How: The output draft draft_reply can be forwarded to Google Sheets using the action Zapier → Google Sheets → Create Spreadsheet Row. Columns:
- Sender
- Date
- Summary
- Reply draft
- Approval (value “YES”/“NO”)
Once the user sets “YES,” another zap is triggered.
Input: draft_reply
Output: an updated sheet with approval status.
Success metric: 90% of drafts do not require major edits once the workflow stabilizes.
Step 6: Sending the approved reply
What and why: The final step ensures that approved replies are sent back via the Gmail API.
How: When a change in the value “Approval = YES” is detected in the sheet, trigger a Zap with the action Gmail → Send Email. Insert the content from draft_reply into the Body field, and the original sender’s address into the To: field.
Example body configuration:
Subject: Re: {{original_subject}}
Body: {{draft_reply}}
Input: draft_reply + recipient_email
Output: a sent email with delivery confirmation.
Success metric: sending completes without a 401 error (authentication) or 400 error (invalid parameters). Delivery of the message can be verified in Gmail.
Testing
For testing, we recommend preparing three types of emails: informational (e.g. a meeting announcement), inquiry-based (a customer asks about a procedure), and escalation (a complaint). Track how accurately the AI creates summaries and drafts. Evaluate based on the metric of how much time you save compared to manually writing replies. Also measure the percentage of incorrectly understood emails – ideally below 10%.
Deployment
After successful testing, the workflow can be run permanently. It is recommended to add monitoring to a spreadsheet (e.g. number of emails per week, delivery success rate, average approval time) and notifications to Slack via the Zapier step Slack → Send Message in case of failure. Automatic occasional rephrasing of prompts can improve reply quality by 5–15% (measured by user ratings).
Limits
- The AI model does not have direct access to older emails unless they are explicitly loaded — it is recommended to limit processing to the last 30 days.
- Zapier offers a limited number of calls for free accounts; with a larger volume of emails, a paid plan is required.
- AI-generated replies may contain factual errors if the email is not unambiguous; they require human validation.
- Without encrypted data storage (e.g. Cloud KMS), the system cannot be used for sensitive data (personal data, contracts).
FAQ
Is it possible to use a different email system than Gmail?
Yes, if the service supports IMAP or its own API (e.g. Outlook via Microsoft Graph API). However, the connection steps need to be slightly adjusted.
How much will API calls cost us?
OpenAI GPT-4-turbo costs approximately USD 0.01 per 1,000 input tokens and USD 0.03 per 1,000 output tokens. Email summarization usually consumes under USD 0.002 per email.
Can the workflow be operated from a mobile device?
Yes – Zapier runs in the cloud, so mobile Gmail for confirmation or Google Sheets for approving replies is sufficient.
How can summary accuracy be improved?
Add a clear instruction to the system prompt so that the AI includes numbers or specific steps. You can also adjust the temperature and max_tokens parameters according to the length of typical emails.
Conclusion
This guide presented a specific workflow implementation for email summarization and reply draft generation using the OpenAI API, Gmail API, and Zapier. You gradually went from connecting to Gmail through creating summaries to sending an approved reply. The result is a functional MVP that can be deployed in practice within a single day and expanded as needed with additional steps such as email categorization or sentiment analysis. The AI assistant can thus significantly speed up everyday communication while maintaining human control over the content of replies.
Recommended next step
Links in the article
Sources of illustrative images
- Stock photo: source
The custom illustrative image was created using the OpenAI Images API.
| Service | Service description | Offer |
|---|---|---|
| NordVPN | VPN service for privacy protection and secure connections. | Open offer |
| Semrush | SEO and marketing platform for analysis and traffic growth. | Open offer |
| Make | Advanced visual automation for workflows and integrations. | Open offer |
| Hostinger | Web hosting and domains for fast website launch. | Open offer |
| Fiverr | Marketplace for freelancers and external specialists. | Open offer |
| Adobe | Creative tools for graphics, video, and digital content. | Open offer |
| Canva | Online design tool for graphics, presentations, and social media. | Open offer |
| Jasper | AI tool for marketing copy and content campaigns. | Open offer |
Note: We use affiliate links for listed services. If you purchase through them, we may earn a commission at no extra cost to you.




