1
我試圖寫一個小谷歌企業應用套件腳本,將發送一封確認郵件,並自動共享的文件夾與登錄的用戶,他們填寫一份表格後。下面是該腳本:谷歌Apps腳本 - 自動通過電子郵件和共享
function formSubmitReply(e) {
MailApp.sendEmail({
to: Session.getActiveUser().getEmail(),
subject: "Keuka College Brand Download Center",
htmlBody:
"<p>Thank you for requesting access to the Keuka College Brand Download Center. Your access has been approved.</p>" +
"<p>You may access the download center by <a href='https://drive.google.com/a/keuka.edu/folderview?id=0B856ZeGoaGT_MG5BMEtEVGwzYkk&usp=sharing'>using this link,</a> " +
"visiting <a href='http://brand.keuka.edu'>Keuka College Brand Central,</a> or through your Google Drive.</p><p>Please contact the Office of Marketing and Communications " +
"with any questions you may have.</p>",
name: "Keuka College",
replyTo: "[email protected]"
});
var folder = DocsList.getFolder('Brand Download Center');
folder.addViewer(Session.getActiveUser());
}
這似乎是工作,但它保持它通過電子郵件發送給我 - 不是誰填寫該表格的用戶。我不確定它是否正確共享。
有人可以提供一些見解嗎?這是我第一次使用Google Apps腳本。
謝謝。我改變了它如下,但它似乎仍然沒有工作。有什麼建議麼? (Partial Code):function formSubmitReply(e){ var email = e.getRespondentEmail(); MailApp.sendEmail({ 到:電子郵件, – Pete 2014-10-10 17:43:02
而且您使用的企業或EDU帳戶 – 2014-10-10 17:44:40
EDU,我相信 – Pete 2014-10-10 17:47:02