通过Google Apps脚本授予权限时需要停止电子邮件通知 [英] Need to stop email notifications when giving permissions via Google Apps Script
本文介绍了通过Google Apps脚本授予权限时需要停止电子邮件通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是Google Apps脚本的新手,我需要在授予权限时停止电子邮件通知.这是我现在拥有的代码.但是它每次都会发送电子邮件通知.
I'm new to Google Apps Script and I need to stop email notifications when I give permissions. This is the code I have right now. But it sends an email notification every time.
function AddUsersToFolder() {
// get folders (FolderIterator) by name, should probably be dynamic
var folders = DriveApp.getFoldersByName('Work');
while (folders.hasNext()) {
// get the current folder from the iterator
var folder = folders.next();
// add viewer(s) and editor(s), should also be dynamic
folder.addEditor('email@business.com');
}
}
推荐答案
您应该在Google App脚本中启用高级驱动器API,并使用Drive.Permissions.insert()方法,并将参数sendNotificationEmails设置为false来禁用通知.
You should enable the Advanced Drive API in Google App Script and use the Drive.Permissions.insert() method with the parameter sendNotificationEmails set to false to disable notifications.
请参见文档.
这篇关于通过Google Apps脚本授予权限时需要停止电子邮件通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文