2

我正在使用 Drive API 和 Google Apps Script UrlFetchApp 来更改文件所有者。它工作得很好,它会为每个文件向新所有者发送一封电子邮件通知。如何隐藏此电子邮件通知?

这是我的部分代码片段

var base = 'https://docs.google.com/feeds/';
var fetchArgs = googleOAuth_('docs', base);
fetchArgs.method = 'POST';

var rawXml = "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gAcl='http://schemas.google.com/acl/2007'>"
+"<category scheme='http://schemas.google.com/g/2005#kind' "
+"term='http://schemas.google.com/acl/2007#accessRule'/>"
+"<gAcl:role value='owner'/>"
+"<gAcl:scope type='user' value='"+newOwnerEmail+"'/>"
+"</entry>";

fetchArgs.payload = rawXml;
fetchArgs.contentType = 'application/atom+xml';
var url = base + encodeURIComponent(oldOwnerEmail) + '/private/full/'+fileOrFolderId+'/acl?v=3&alt=json';
var content = UrlFetchApp.fetch(url, fetchArgs).getContentText(); 
4

1 回答 1

0

您必须添加sendNotificationEmails=false到您的请求以修改文件的权限

于 2013-03-26T12:04:35.390 回答