Gmail - AI - Draft Reply

Hi all :slight_smile:

I am working on an automation that when an email is received in Gmail and a label is applied to it an automation is triggered which sends the email copy to OpenAI API and draft an email reply. The problem I am facing is how can I draft a reply in the received email thread? I don’t want to draft a whole new email and is there a way to then remove the label from the email so it can run again in the future? Wondering if anyone has done this and has advice?

Thanks :slight_smile:

According to the Gmail guide on Managing Threads:

If you are sending or migrating messages that are a response to another email or part of a conversation, your application should add that message to the related thread. This makes it easier for Gmail users who are participating in the conversation to keep the message in context.

In order to be part of a thread, a message or draft must meet the following criteria:

  1. The requested threadId must be specified on the Message or Draft.Message you supply with your request.
  2. The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
  3. The Subject headers must match.

Unfortunately, the Gmail “Create a Draft” module doesn’t allow you to set the fields “Headers”, “In-Reply-To”, and “References”, so you cannot do this in Make.

For more information, see python - How to create a draft message in existing thread with gmail API - Stack Overflow

You can submit this suggestion to the Idea exchange, under App improvement ideas. Don’t forget to search for it first, just in case someone already suggested it!

You can also wait for the generic Make an API call module to be made. A user Tereza Klobouckova shared a possible workaround for now by creating a custom OAuth client to manually use Gmail API endpoints.

2 Likes

Thanks so much, but this can be done in Zapier really easily so I don’t understand why this is not available in Make? Thanks

Like I said, the fields aren’t implemented in the Make Gmail module yet. You can submit this suggestion to the Idea exchange, under App improvement ideas. Don’t forget to search for it first, just in case someone already suggested it!

2 Likes

Ah ok thanks, hopefully they come soon :slight_smile:

2 Likes