The following code from Alex's code on Google Forms onsubmit will send an email when a form attached to the spreadsheet is submitted.
function onSpreadsheetSubmit(e) {
var row = e.range.getRow();
MailApp.sendEmail("me@example.com",
"Your subject, rows: "+ row,
"A new application has been submitted on row: "+
row,
{name:"From your friendly spreadsheet"});
}
The code successfully returns the row number of the submission using e.range.getRow()
How can I get the name of the sheet that the form is connected to?
E.g. something like e.range.getSheet()
Although this question How to get form values in the submit event handler? discusses retrieving the event values, I do not believe that it addresses directly the retrieval of the name of the sheet.
And how can I elegantly get the data of the new row?