Created
August 21, 2019 22:52
-
-
Save hoosteeno/bafe1146acb436f7695118f02f03ca30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://gist.github.com/hoosteeno/aeabac67db5a57817c4070df8f8f7a80 | |
function onFormSubmit(e) { | |
var dest = 'anemail@example.com'; | |
var values = e.values; | |
var s = SpreadsheetApp.getActiveSheet(); | |
var headers = s.getRange(1,1,1,s.getLastColumn()).getValues()[0]; | |
var subject = "#Incoming " + values[2].substring(0,68); // max subject length 78 chars | |
var message = ""; | |
for (var i = 0; i<values.length; i++) { | |
var question = headers[i]; | |
var response = values[i]; | |
message = message + '**' + question + ':** ' + response + '\n\n'; | |
} | |
GmailApp.sendEmail(dest, subject, message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment