How does a Gmail message Id or ThreadId map to the new Gmail UI?

后端 未结 3 779
离开以前
离开以前 2020-12-13 15:15

Edit: addressing the first comment below and for clarity, this isn\'t a code question. The question is simply:

What do I put into t

相关标签:
3条回答
  • 2020-12-13 16:06

    Thanks to @frank-szilinski - he pointed out that the old format is now translated. I.e. this now works again:

    https://mail.google.com/mail/ca/u/1/#drafts/1661237c4db71ace

    It doesn't seem to work when the Gmail tab isn't already open, however.

    0 讨论(0)
  • 2020-12-13 16:14

    Building on @kremonte gist, and @chris-wood comments, I made a rails gem that correctly creates the open-the-draft-inside-gmail URL.

    It's here - https://github.com/GoodMeasuresLLC/gmail_compose_encoder

    It's for the use case of "my code created a draft (prepopulated with some text, of course) and now I want to open the draft in compose mode so that my user can review it before hitting "send".

    0 讨论(0)
  • I've been encountering the same problem and have had some success in this problem, as well as some issues I still can't get past.

    Good news: The new compose parameter format is some kind of "base40" encoding. I searched the Gmail source for a restricted alphabet string, and found and deobfuscated the bit of code doing this encoding/decoding: https://gist.github.com/danrouse/52212f0de2fbfe33cfc56583f20ccb74

    This code includes an encode and decode function which should work for Gmail-format query parameters.

    Bad news: The values that it is encoding to open draft emails do not appear to be available using the Gmail API. Specifically, they look like this: thread-f:NEW_THREAD_ID+msg-a:DRAFT_ID -- while the draft ID is the same as it was before, the Thread ID does not appear to match any of the IDs that the Gmail API returns.

    Interestingly, if you inspect the subject row in the Gmail UI, it has dataset attributes including all of both the old format and new format IDs - but it's still unclear how to get the new ones programatically.

    0 讨论(0)
提交回复
热议问题