I've set up a Google form and my responses are being recorded in a spreadsheet. Ideally I want the responses to also be sent via email.
I found this article, but it looks like this script only sends an email from a message field. I want to send the entire spreadsheet.
https://developers.google.com/apps-script/articles/sending_emails
Is there a way to do this?
Send a spreadsheet when Google form is submitted.
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'
});
};
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.