How to attach Google Slides with Gmailapp sendemail

五迷三道 提交于 2019-12-13 04:35:57

问题


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.

来源:https://stackoverflow.com/questions/52998990/how-to-attach-google-slides-with-gmailapp-sendemail

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