Gmail Draft in Same Email Thread

@KyleBehrend Okay, so to create a draft, here’s one way:

HTTP Make an OAuth 2.0 request (set it up as described in the docs you referenced in your first post)
URL
image

Method
POST

Body type, Content type, and Request content
image

Thread ID comes directly from the GMail module that received the message you’re replying to. The key here is adding this threadId, otherwise it just comes out as a standard draft message.

Encoded Message you will need to build. At a minimum, to make sense as a draft reply, it should contain To, From, Subject, and Body.

Encoded Message is these components base64-encoded
image

Unencoded Message is the actual text
image

To and Subject come from the Gmail module that received the message we are replying to. I pre-pending the subject with "Re: ".

Body is in there too, but it’s just text. I believe it would also support HTML, but haven’t tested.

Please see blueprint for demo. For this, I configured the source Gmail module to pull in unread emails from my “Test” folder (emails labeled “Test”).

GmailDraftReply.json (21.2 KB)

Hope this helps!

6 Likes