Share a Drive document without notifying user with Google Apps Script

前端 未结 3 1109
梦毁少年i
梦毁少年i 2020-12-03 08:10

I am creating a workflow process in Apps Script where a Doc is generated from a template and shared with various users for approval. The Script sends a customised email noti

3条回答
  •  天涯浪人
    2020-12-03 08:17

    There is a simple solution if you are working with Google Docs or Google SpreadSheets. You can use DocumentApp or SpreadSheetApp to share your Docs or SpreadSheets without email notification:

    DocumentApp

    var doc = DocumentApp.openById('124144')
    doc.addEditor('example@mail.com').addViewer('example2@mail.com')
    

    SpreadSheetApp

    var spreadSheet = SpreadsheetApp.openById('124144')
    spreadSheet.addEditor('example@mail.com').addViewer('example2@mail.com')
    

    However, if you are working with documents that aren't Docs or SpreadSheets, you must share then using DriveApp and email notification will be send.

提交回复
热议问题