Skip to content

Instantly share code, notes, and snippets.

View macaullyjames's full-sized avatar

Macaully James Muir macaullyjames

View GitHub Profile
@macaullyjames
macaullyjames / Code.gs
Last active October 16, 2017 09:22
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
@macaullyjames
macaullyjames / Code.gs
Last active August 5, 2017 13:30
Google Scripts code for sending SMS from Google Sheets – from https://medium.com/46-thoughts/send-sms-from-google-spreadsheet-71f11d358361
function elksSMS() {
// Get the properties
var prop = PropertiesService.getScriptProperties();
var username = prop.getProperty('46elksUsername');
var password = prop.getProperty('46elksPassword');
var spreadsheetID = prop.getProperty('SpreadsheetID');
var sender = prop.getProperty('46elksAccountPhoneNumber');
var auth = Utilities.base64Encode(username + ":" + password);
// Open the requested SpreadSheet and Sheet
filetype plugin on
set nu
syntax on
set sw=2
set ts=2
set ai
set et
set clipboard=unnamed