How to attach Google Slides with Gmailapp sendemai

2019-09-01 03:36发布

I am trying to send some google slides from the drive as attachment to Gmailapp sendemail function. It always seem to send pdf, and if I use blob it sends a corrupt file which doesnt open on windows.

Here is what I am doing:

function testemail() {
  var email = "name@domain.com";
  var subject = "hello world";
  var body = "testing";
  var flyerFile = DriveApp.getFileById("1fiopyqtue");
  var flyerBlob = flyerFile.getBlob();
  GmailApp.sendEmail(email,subject ,body, {attachments:[flyerFile.getAs(MimeType.GOOGLE_SLIDES)]});
  GmailApp.sendEmail(email,subject ,body, {attachments:[flyerBlob]});
}

This one is very simple but I cant seem to get it working. Cant find any answer too. Thanks for helping out.

0条回答
登录 后发表回答