How To Attach A Google Drive File In Message And Send Through Gmail Api (without Downloading The File)?
Solution 1:
The problem with Google Apps is that you cannot preserve the data type when downloading or exporting them - they need to be converted to a different MIMEType. Thus, If you have problems sending e-mails with an attachment, I suggest you to do the following workaround: Include in your e-mail a link to the file, rather than the file itself. In this case you have to perform the following steps:
Share the file of interest with the respective user. This is something you can do programmatically by creating and updating permissions. In your case, you need to specify emailAddress, the fileID, as well as include in the request body the role you want to give to the email recipient. In case you update an existing permission, you also need to specify the permissionId. Include the webViewLink of the desired file in your email body. You can obtain the webViewLink by listing files and specifying the webViewLink as a field you want to obtain in your response
Post a Comment for "How To Attach A Google Drive File In Message And Send Through Gmail Api (without Downloading The File)?"