Emails/drafts sent via Gmail REST API can't be opened in the new Gmail UI

南楼画角 提交于 2019-12-08 15:47:17

问题


When sending drafts via the Gmail REST API, the message in the "Sent Mail" folder can't be opened by the sender in the new Gmail UI. You get the error message "The conversation that you requested could not be loaded.".

The message on the recipient side can be opened without problem though, new UI or not.

Reverting to the old/classic Gmail UI allows the sender to open the sent message.

Steps to reproduce:

  1. Compose a draft in Gmail (new or old UI doesn't matter)
  2. Find the draft ID via GET https://www.googleapis.com/gmail/v1/users/me/drafts
  3. Send the draft via POST https://www.googleapis.com/gmail/v1/users/me/drafts/send with body {"id": "<draftId>"}
  4. Go back to Gmail and switch to the new Gmail UI, then attempt to open the recently sent draft in the Sent folder. Attempting to open the message will fail.
  5. Revert to the old/classic Gmail UI and open the recently sent draft in the Sent folder. You will be able to open the message without issues.
  6. The recipient will be able to open the message without issues, using either the new or old UI.

UPDATE

When the broken sent email receives a reply, it seems to get 'fixed' and the sender can now open the sent email from the new Gmail UI. This seems to suggest that the REST API is missing something that gets fixed once the thread is updated by other means?

The error message in the browser console when attempting to open the broken sent message:

Error: Ppa No message loaded when we received the DETAILED_CONVERSATION_MESSAGES_LOADED event.


回答1:


I can't reproduce this. Note that in the reproduction steps #2 is unnecessary. Instead, the result of drafts.create() in #1 should be analyzed, the id of the new draft message is present there.

Also worth noting, Draft IDs are not the same as Message IDs. The response of drafts.create() and drafts.update() will be a Draft ID while the result of drafts.send() will be the message ID. When viewing the sent message in Gmail UI make sure you are using the message ID.



来源:https://stackoverflow.com/questions/50558425/emails-drafts-sent-via-gmail-rest-api-cant-be-opened-in-the-new-gmail-ui

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!