问题
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