我已经建立了一个Google表单,我的回复被记录在一个电子表格中。理想情况下,我希望回复也通过电子邮件发送。
我找到了这篇文章,但看起来这个脚本只从消息字段发送一封电子邮件。我想把整个电子表格都发出去。
有办法这样做吗?
发布于 2015-03-23 16:24:35
当Google表单提交时,发送电子表格。
创建一个触发器,以便在提交表单时运行:
设置触发器:
编写代码:
function respondToFormSubmit(e) {
Logger.log('respondToFormSubmit ran');
fncGetContentToSend();
fncSendEmail();
}
function fncGetContentToSend() {
Logger.log('fncGetContentToSend ran');
var thisSS = SpreadsheetApp.openById('your ID');
//Convert spreadsheet to PDF
}
function fncSendEmail() {
Logger.log('fncSendEmail ran');
// Send an email with a file from Google Drive attached as a PDF.
var file = DriveApp.getFileById('1234567890abcdefghijklmnopqrstuvwxyz');
GmailApp.sendEmail('mike@example.com', 'Attachment example', 'Please see the attached file.', {
attachments: [file.getAs(MimeType.PDF)],
name: 'Automatic Emailer Script'
});
};
https://stackoverflow.com/questions/29221567
复制