Skip to content

Instantly share code, notes, and snippets.

@JEverhart383
Created November 30, 2015 14:15
Show Gist options
  • Select an option

  • Save JEverhart383/34a5a3265f2755691bfe to your computer and use it in GitHub Desktop.

Select an option

Save JEverhart383/34a5a3265f2755691bfe to your computer and use it in GitHub Desktop.
function sendFormByEmail(e)
{
var email = "digitaledcollaborator@gmail.com";
var becky = "dec@longwood.edu";
var subject = "Google Docs Form Submitted";
var s = SpreadsheetApp.getActiveSheet();
var headers = s.getRange(1,1,1,s.getLastColumn()).getValues()[0];
var message = "";
for(var i in headers)
message += headers[i] + ' = '+ e.namedValues[headers[i]].toString() + "\n\n";
MailApp.sendEmail(becky, subject, message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment