0
votes

I'm quite new to Google App Script and playing around with GmailApp.sendEmail. When I try to send several Email with the same subjects, how can I make them grouped in one single Conversation (given that the Gmail of receiver has Conversation option turn on).

Many thanks, Minh

1

1 Answers

0
votes

Since you're using GmailApp, take a look at the Gmail Thread Class. If you use thread.replyAll(body, options) to respond to the first message you sent, the second message will appear in the same thread in the receiver's mailbox.

When sending the first message, you would need to cc yourself for it to end up in your own inbox, then you could use [GmailApp.search()][2] to find the threads with messages matching the one you sent. From there, drill down to the thread, and replyAll.