Deepak
Deepak

Reputation: 57

How do i send a email on same thread using google-api-nodejs-client nodejs

I have full response of a email send using node module google-api-nodejs-client, which is like { "id": "1231212312", "labelIds": ["UNREAD", "SENT", "INBOX"], "threadId": "23123123" }

I need to send an email again to the email address but in the same thread not as a new email.

I checked the documentation but wasn't able to find relevant stuff.

Here is the link to its documentation: https://github.com/google/google-api-nodejs-client/blob/master/apis/gmail/v1.js#L796

Thanks!

Upvotes: 0

Views: 1805

Answers (1)

Steven Lu
Steven Lu

Reputation: 2180

In order to make your message display in the same thread you need to make it RFC compliant which means you need to add the In-Reply-To and References header that includes the Message-ID (also a header) of the previous message.

Afterwards, you can then provide the threadId to the Gmail API which will then send it as the same thread. Gmail also requires that your "subject" be the same as the previous message.

References:

Upvotes: 1

Related Questions