1

I'm using the GMail API in Go(lang). After each email arrives I am 'inserting' (not sending an email onto the same thread (with stats about how many times you have communicated with this person etc etc...

What I want to end up with is the original incoming email trashed, and the inserted email first in the thread. The content of the original email is appended to the inserted email.

All works, except that when I trash the email with the ID of the original email, the entire thread disappears.

Is this because the appended email is inserted and not 'sent' to the thread? I wouldn't have thought so because it gets given a real messageID, so is it because I am trashing the first email in a thread, and that therefore trashes the whole thread?

I thought trashing should just trash the message, regardless of its 'ownership' of the thread. Thanks

9000
  • 39,899
  • 9
  • 66
  • 104
amlwwalker
  • 3,161
  • 4
  • 26
  • 47
  • Does it differ from the behavior of the web UI? Is it even possible to trash an email that starts a thread without trashing the whole thread? – 9000 Feb 22 '17 at 17:18
  • @9000 Just tested. Clicking on the first message and choosing 'Delete this message' does indeed, just remove that message and leaves the rest of the thread in place – amlwwalker Feb 22 '17 at 17:20

1 Answers1

0

You may refer with this post although the issue here is to retrieve the specific email within a thread. It stated that it is not currently possible because it is part of the email's body content and you're specifying the ID of the message to trash. You can only trash other messages within a thread, but not the primary message since the messageId and the threadId of the first email is the same. Yes, using the Gmail App it's working, but I think it is not yet supported using the API. You can file a feature request for this.

Community
  • 1
  • 1
abielita
  • 13,147
  • 2
  • 17
  • 59
  • Ok. Is there a way to start a new thread and make sure an email won't end up in an existing thread even if subject, sender etc is the same? – amlwwalker Feb 23 '17 at 08:52