Prompt Engineering Guide
πŸ˜ƒ Basics
πŸ’Ό Applications
πŸ§™β€β™‚οΈ Intermediate
🧠 Advanced
Special Topics
🌱 New Techniques
πŸ€– Agents
βš–οΈ Reliability
πŸ–ΌοΈ Image Prompting
πŸ”“ Prompt Hacking
πŸ”¨ Tooling
πŸ’ͺ Prompt Tuning
πŸ—‚οΈ RAG
🎲 Miscellaneous
Models
πŸ“ Language Models
Resources
πŸ“™ Vocabulary Resource
πŸ“š Bibliography
πŸ“¦ Prompted Products
πŸ›Έ Additional Resources
πŸ”₯ Hot Topics
✨ Credits
πŸ’Ό Applications🟒 Zapier for Emails

Zapier for Emails

🟒 This article is rated easy
Reading Time: 5 minutes
Last updated on August 7, 2024

Sander Schulhoff

Takeaways
  • Purpose: This article explains how to set up Zapier and GPT-3 to automatically summarize and store emails, helping to save time and improve productivity.

Introduction

We have already seen how useful GPT-3 can be when it comes to emails. It can be even more so when you combine it with nocode tools like Zapier or Bubble.io.

This article will contain an example of what Zapier+GPT-3 can do with only a small amount of setup time. This article focuses on a particular example, but the possibilities are much greater. We'll give some other examples along the way. Keep in mind you can also do this in Bubble.io. There are many other nocode tools, but at the time of writing only very few allow you to use GPT-3.

In this article, we will show you how to set up a simple system in Zapier in which e-mails are summarized and stored. Have a meeting with someone? Quickly check the summaries of emails you've exchanged with that person. Setting this up takes about 20 minutes.

Caution

It is helpful to already know Zapier for this article. If you don't, you can check out this article.

General Idea

Below is a diagram of what we will be doing here in Zapier. Whenever an email comes into your inbox, it will trigger Zapier. There are four steps (for now):

  1. Email comes in and triggers Zapier
  2. Format the content of the email (to remove the HTML markdown, for example).
  3. Send it to GPT-3 to be summarized
  4. Store the output in a database

Set-up in Zapier

Make sure to have a Zapier account (you can get a free one). Setting it up should be fairly straightforward. After creating your account, expand the box below to see full descriptions of each Zapier action we need to create.

Expand for a more detailed view of the steps in Zapier

This is what the Zapier action diagram will eventually look like.


Step 1: Gmail trigger on new incoming email (Gmail is used here).

Step 2: Formatter for E-mail content.

Step 3: Prompting the Email content


Step 4: Adding it to a database

Here is a setup in Zapier that allows you to do a very basic summary as shown in the diagram. It has its limitations, but it does do the job and can build up a useful database.

Optimizing the Prompt for Better Results

There are a few easy ways to improve your results. Adding context and role prompting can improve the output. However, the topic and contents of your emails might cover a wide range of topics. This means that general instructions will do a better job than very specific ones, which might throw the model off.

For practical reasons, it is useful to give an instruction, followed by telling GPT-3 when the email starts in the prompt by simply adding "Email: " and ending the prompt with ""Summary": ". This avoids GPT-3 answering with "Sure! I can summarize it for you...".

Role prompting can be useful here as well. Asking GPT-3 to act as a personal assistant helps increase the quality of the summary. If you want to summarize work emails, simply adding the role you have gives GPT-3 context to work with. It acts as if it assumes some level of knowledge from the reader, which helps filter out the non-relevant parts of the email. Below we show some examples of emails an office administrator might receive.

You can ask it to summarize a simple email in bullet points, however, this might not be all that useful depending on how you would like to use the summary. For quick skimming of email exchanges, you might just want it to be concise. Simply asking for this in the prompt works well. Below is an example of this prompt. Adjust it and play around with it to see how it changes.

The response here is acceptable and would be useful. However, with some further fine-tuning, you can get a better result. As the reader of the summaries you don't care that it's an email, you might want a lower level of detail for the summary. Information about the why is irrelevant, the same goes for the last sentence about questions and concerns. By simply adding that the goal of the summary is for you to skim the contents and that you want pleasantries removed, the result can be improved.


Now you're left with only the most important parts of the summary!

Other Use Cases

Now that you've seen the example of summaries, We will mention a few other use cases for Zapier+GPT-3. One great example is letting GPT-3 categorize your emails. This just comes down to telling it in a prompt to categorize the following email into whatever categories you like.

A more in-depth example would be having multiple prompts. You can use a prompt to generate a response that agrees with the demands of the email and one that disagrees or denies it. Both can be stored in your drafts and be ready to go whenever you want to send them.

If you regularly receive very similar emails, you can use a filter in Zapier to apply a prompt ONLY to that email. This can be a powerful tool when combined with a formatter. You can extract information and export CSVs from them or directly store them in some form of a database.

Concerns

Please do keep in mind privacy concerns when running emails through GPT-3 and storing them. GPT-3 sometimes makes mistakes. We highly recommend checking email content before sending it.

Sander Schulhoff

Sander Schulhoff is the Founder of Learn Prompting and an ML Researcher at the University of Maryland. He created the first open-source Prompt Engineering guide, reaching 3M+ people and teaching them to use tools like ChatGPT. Sander also led a team behind Prompt Report, the most comprehensive study of prompting ever done, co-authored with researchers from the University of Maryland, OpenAI, Microsoft, Google, Princeton, Stanford, and other leading institutions. This 76-page survey analyzed 1,500+ academic papers and covered 200+ prompting techniques.