Is there a way to attach gmail message body content into the attachment that is also present in the same mail? For example: I have some body text content and 9 page of pdf, so final object/blob could be of 10 pages with body as the first page and remaining 9 pages from the attachment.
I am uploading the final object on google drive.
Or alternative way could be is there a way to add body content when I am creating a file on google drive?
mimetype: pdf
var attachment = message.getAttachments()[0];
const folderId = 'MyFolderId';
Drive.Files.insert({
title: attachment.getName(),
mimeType: attachment.getContentType(),
parents: [{ id: folderId }]
},
attachment.copyBlob()
);