Send SMS Notifications from Google Sheets Using Twilio and Apps Script
Sometimes an email isn't enough — you need to send an SMS. Twilio's API makes this easy, and Apps Script's UrlFetchApp can call it directly from your spreadsheet.
Set up a sheet with columns: Name (A), Phone (B), Message (C), Sent? (D).
functionsendBulkSms(){const sheet =SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();const data = sheet.getDataRange().getValues().slice(1);// Skip header data.forEach((row, i)=>{const[name, phone, message, sent]= row;if(sent ==='Yes'||!phone ||!message)return;sendSms(phone, message.replace('{{name}}', name));// Mark as sent sheet.getRange(i +2,4).setValue('Yes');Utilities.sleep(500);// Respect Twilio rate limits});Logger.log('Bulk SMS complete.');}
Send an alert when a value crosses a threshold
functioncheckAndSmsAlert(){const sheet =SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();const stockLevel = sheet.getRange('B2').getValue();const threshold =50;if(stockLevel < threshold){sendSms('+15559876543',`⚠️ Low stock alert! Current level: ${stockLevel} units (threshold: ${threshold}).`);}}
Schedule a daily SMS reminder
functionscheduleDailySms(){ScriptApp.newTrigger('sendDailyReminder').timeBased().everyDays(1).atHour(9).create();}functionsendDailyReminder(){sendSms('+15551234567','Good morning! Don\'t forget to review your daily report in Google Sheets.');}
Tips
Twilio trial accounts can only send SMS to verified numbers. Upgrade to a paid account for unrestricted sending.
Phone numbers must be in E.164 format: +15551234567 (country code + number, no spaces or dashes).
Twilio charges per SMS — keep an eye on your usage in the Twilio Console.
For two-way SMS (receiving replies), look into Twilio's webhook configuration and Apps Script Web Apps.
The Twilio free tier gives you a small credit to test with — plenty to build and verify your integration.