Skip to content

Instantly share code, notes, and snippets.

@ToorDev
ToorDev / AirtableTwilioSMS.js
Created February 15, 2022 09:46 — forked from sahilda/AirtableTwilioSMS.js
Airtable script: using Twilio to send SMS messages via records
let rentalTable = base.getTable("Rental Units");
let rentedView = rentalTable.getView("Rented");
let rentedViewQueryResult = await rentedView.selectRecordsAsync();
let tenantTable = base.getTable("Tenants")
let tenantQueryResult = await tenantTable.selectRecordsAsync();
const sendSMS = async (phoneNumber) => {
let message = `Dear tenant, this is an automated message serving as a reminder that your rent is due for this month. If you've already paid, you can ignore this message. Thanks!\n\nPlease do not respond to this message. For questions contact us at 123-456-7890`
let urlString = `https://api.twilio.com/2010-04-01/Accounts/<<accountSsid>>/Messages.json`