getAttachments() in GmailApp doesn't include linked files from GDrive

╄→尐↘猪︶ㄣ 提交于 2019-12-11 14:39:40

问题


I am developing an add-on for Gmail. I use Google Apps Script builtin service GmailApp to fetch data from Gmail servers. I have a need to read both attachments and files linked from GDrive in a message.

The builtin GMailMessage.getAttachments() is returning only the standalone attachments but not the files linked from GDrive. The intention of the API is right, those are not attachments. But I just wanted to know is there a way I can query Gmail to fetch me those linked files.

I have considered the following solution:

  • Decode the body. Extract the file id from it. Query DriveApp to get the file data.

Would be great if there is a better solution than this.

来源:https://stackoverflow.com/questions/55182238/getattachments-in-gmailapp-doesnt-include-linked-files-from-gdrive

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