我已经设置了Google表单,我的回复正在电子表格中记录。理想情况下,我希望通过电子邮件发送回复。
我发现了这篇文章,但看起来这个脚本只会从消息字段发送一封电子邮件。我想发送整个电子表格。
https://developers.google.com/apps-script/articles/sending_emails
有办法做到这一点吗?
答案 0 :(得分:0)
提交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'
});
};