Learn to intercept, convert, and analyze email attachments using Zapier and OpenAI for maximum productivity.
Learn how to enhance your email attachment workflow with no-code tools like Zapier and ChatGPT.
Discover how to automatically extract the contents of attachments and use them in conversations with ChatGPT, boosting efficiency and productivity.
The prompts used in this technique are available for download.
This Article’s Use Case
Automate analysis of email attachments to inform downstream communication and or tasks.
- As part of a production workflow, you receive documents (MS Word, Excel) as email attachments;
- Store the attachments in a knowledge base;
- Extract the CONTENTS of the attachment;
- Pass the CONTENTS of the attachment in a conversation with ChatGPT;
- Based on ChatGPT's reply, trigger downstream communication and or tasks.
add flow image
The Tools You Need
To follow along, you'll need:
- Google Drive and Gmail: You can use Outlook 365, but we’ll focus on Google Workspace.
- Zapier Pro Account: This is a multi-step process, so a Pro account is necessary.
- OpenAI API Access: API access with available credit. You will need an API key.
- Monday.com Account: The trial version is fine.
Setting Up Your Tools
Before diving into the automation, ensure your Zapier account is set up, and you have created a new Zap. You need access to the OpenAI API and require an API key.
This tutorial, Exploring AI Automations, gives you instructions on the above setup tasks.
Overview of the Automation Flow
Here’s a quick overview of the steps in the Zap flow:
- Trigger: A new email matching a search in Gmail.
- Find Attachment: Upload the attachment to Google Drive.
- Convert Document to Text: Use Zapier to convert the document to text.
- ChatGPT Conversation: Use the extracted text in a ChatGPT conversation.
- Create Draft Email: Use ChatGPT’s output to create a draft email.
- Add Task to monday.com: Create a task in monday.com with the relevant data.
Watch the video>>>.
Step-by-Step Guide
Step 1: Email Interception
Set up a new email matching search in Gmail. For this example, we’re looking for the keyword “brief” in the email subject.
Step 2: File Upload to Google Drive
Once the email is found, the attachment is uploaded to a designated folder in Google Drive. Ensure the file permissions are set correctly.
Step 3: Convert to Google Doc
It’s crucial to convert the uploaded file to a Google Doc format. This allows us to extract the text content, which isn’t possible with a Word document.
Step 4: Find the file on Google Drive
We now find the file just uploaded to Google Drive. This is so that we can use the 'Raw Text' version of the file. Google creates various versions of the file, Text, PDF, Zip etc. We make use of this feature.
Step 5: Extract Text Using Zapier
Zapier’s “Text from file” action helps convert the Raw Text Google Doc into a text format. This text will be used in the next step with ChatGPT.
Step 6: ChatGPT Analysis
Set up a conversation with ChatGPT, assigning it the role of a specialist in parsing and analysing text from documents. The task is to convert the text into clean JSON format, ready for further processing.
Step 7: Convert JSON to Variables
Use JavaScript to convert the JSON output from ChatGPT to variables. We now have the data in usable format.
Step 8: Create Draft Email
Use a Gmail action to create a draft email. Add dynamic text data from the JavaScript step to the Draft email.
Step 9: Add Task to monday.com
Finally, add a task to Monday.com, using data from the document to ensure all necessary details are included.
Demonstration
To illustrate this process, we conducted a live demo using a complex Word document as an attachment. The document was sent via email, intercepted by our Zap, and processed through each step seamlessly. The task was added to monday.com, showing the automation flow works perfectly.
The demo can be found on this video: Automate Extraction of Email Attachments.
Conclusion
This tutorial showcases the practical application of no-code automation, making business processes more efficient. If you found this tutorial useful, please subscribe to our channel for more insights on AI and automation. Thank you for watching, and see you in the next video. Ciao!
TL;DR
Too busy to read the whole article? Here's the gist: You can improve your email attachment workflow using no-code tools like Zapier and ChatGPT.
Automatically extract attachment contents and use them in ChatGPT conversations for maximum efficiency.
Watch the Accompanying Video
The video explains the techniques discussed here in some detail.
Article Resources
Links and downloads:
- The prompts used can be found here as a Google Doc.
Subscribe
Explore the practical possibilities of AI for your business. Subscribe to our newsletter for insights and discussions on potential AI strategies and how they are adopted.
Contact Me
I can help you with your:
- Zapier Automations
- AI strategy;
- Prompt engineering;
- Content creation;
- Custom GPTs.
I am available for remote freelance work. Please contact me.
References
This article is made possible due to the following excellent resources:
Reference citations
Recent Articles
The following articles are of interest:
Add new comment