Skip to content

Instantly share code, notes, and snippets.

@macaullyjames
Last active October 16, 2017 09:22
Show Gist options
  • Save macaullyjames/c2be2cad8e41e57de0fc364f16a5416e to your computer and use it in GitHub Desktop.
Save macaullyjames/c2be2cad8e41e57de0fc364f16a5416e to your computer and use it in GitHub Desktop.
Google Scripts code for forwarding SMS to Google Sheets – from https://medium.com/46-thoughts/receive-sms-into-google-spreadsheet-435b51393493
function doPost(e) {
// Open the requested SpreadSheet and Sheet:
var prop = PropertiesService.getScriptProperties();
var spreadSheet = SpreadsheetApp.openById(prop.getProperty('SpreadSheetID'));
var sheet = spreadSheet.getSheets()[0];
// Append the data to the sheet on a new row:
sheet.appendRow([new Date(), e.parameter['from'], e.parameter['message']]);
// Return a empty text string to 46elks
return ContentService.createTextOutput("");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment