{"id":18112108,"url":"https://github.com/philnash/community-sms-broadcast","last_synced_at":"2025-04-14T03:43:43.264Z","repository":{"id":43486399,"uuid":"248697780","full_name":"philnash/community-sms-broadcast","owner":"philnash","description":"An application that you can use to broadcast SMS messages to people listed on a Google Spreadsheet, powered by Twilio Functions and Twilio Programmable SMS","archived":false,"fork":false,"pushed_at":"2023-02-03T05:24:14.000Z","size":385,"stargazers_count":8,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T17:47:05.395Z","etag":null,"topics":["google-sheets","sms","twilio","twilio-api","twilio-functions"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philnash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-20T07:52:42.000Z","updated_at":"2022-03-02T18:10:26.000Z","dependencies_parsed_at":"2023-02-08T20:15:44.620Z","dependency_job_id":null,"html_url":"https://github.com/philnash/community-sms-broadcast","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philnash%2Fcommunity-sms-broadcast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philnash%2Fcommunity-sms-broadcast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philnash%2Fcommunity-sms-broadcast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philnash%2Fcommunity-sms-broadcast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philnash","download_url":"https://codeload.github.com/philnash/community-sms-broadcast/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819118,"owners_count":21166470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-sheets","sms","twilio","twilio-api","twilio-functions"],"created_at":"2024-11-01T01:09:25.783Z","updated_at":"2025-04-14T03:43:43.236Z","avatar_url":"https://github.com/philnash.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Community SMS Broadcast\n\nThis repo is an example application that you can use to broadcast SMS messages to people listed on a Google Spreadsheet, powered by [Twilio Functions](https://www.twilio.com/docs/runtime/functions) and [Twilio Programmable SMS](https://www.twilio.com/docs/sms).\n\nThe idea is that a community can put together a spreadsheet that includes names, numbers and other details (like house number) to differentiate themselves. Then community members can then send an SMS message to a Twilio number and have that message broadcast to the rest of the community.\n\nWant to see how to build this application? Check out the blog post [build a community SMS group chat with Twilio Functions and Google Sheets](https://www.twilio.com/blog/community-sms-group-chat-twilio-functions-google-sheets).\n\n* [What you need](#what-you-need)\n* [Setting up the app](#setting-up-the-app)\n  * [Spreadsheet setup](#spreadsheet-setup)\n  * [Google credentials setup](#google-credentials-setup)\n  * [Twilio Setup](#twilio-setup)\n    * [Twilio Serverless Toolkit](#twilio-serverless-toolkit)\n    * [Twilio Functions UI](#twilio-functions-ui)\n  * [You're ready](#youre-ready)\n* [LICENSE](#license)\n\n## What you need\n\n- [A Twilio Account](https://www.twilio.com/try-twilio)\n- [A Google developer account](https://console.developers.google.com/)\n- A Google spreadsheet with three columns, headed \"Number\", \"Name\", and \"House\" in that order (you can change this, but you will need to update the code)\n\n## Setting up the app\n\nWe need to do a few things to use this app, including preparing credentials to make the spreadsheet accessible from the Twilio Function.\n\n### Spreadsheet setup\n\n- [Create a new Google Spreadsheet](http://sheets.google.com/)\n- Give it the column headings \"Number\", \"Name\", and \"House\" in that order\n- Enter your community member phone numbers, names and house numbers (or other identifying detail you want to include)\n\n### Google credentials setup\n\n- In the [Google developer console](https://console.developers.google.com/), create a new project.\n- Click _Enable API_. Search for and enable the **Google Drive API**\n- _Create Credentials_ for a _Web Server_ to access _Application Data_\n- Name the service account and grant it a _Project Role_ of _Editor_\n- Download the JSON file of credentials and open it up\n- Find the \"client_email\" key in the JSON file and get the email address. Back in your spreadsheet click the _Share_ button and paste the client_email into the share field to give that email address access to the spreadsheet. We'll need these credentials again, so keep them safe\n\n### Twilio Setup\n\n- In your Twilio console [buy a new phone number with SMS capabilities](https://www.twilio.com/console/phone-numbers/search)\n\nYou can deploy the Twilio Function for this application two ways, using the [Twilio Serverless Toolkit](#twilio-serverless-toolkit) or the [Twilio Functions UI](#twilio-functions-ui).\n\n#### Twilio Serverless Toolkit\n\nYou will need [Node.js installed](https://nodejs.org/en/download/) to perform this method.\n\n- Clone this repo\n\n      git clone https://github.com/philnash/community-sms-broadcast.git\n\n- Change into the directory and install the dependencies\n\n      cd community-sms-broadcast\n      npm install\n\n- Copy the `.env.example` file to `.env`\n\n      cp .env.example .env\n\n- Fill in the `.env` file with your Twilio Account Sid and Auth Token (available in your [Twilio Console](https://www.twilio.com/console/))\n- Open your Google Spreadsheet and look at the URL bar, it should look like `https://docs.google.com/spreadsheets/d/{GOOGLE_SPREADSHEET_KEY}/edit#gid=0`. Take the string that represents your `GOOGLE_SPREADSHEET_KEY` and enter that into `.env`\n- Take the Google credentials JSON file you downloaded earlier and move it into the assets directory. Call it `assets/credentials.private.json`.\n- [optional] Open `functions/community-sms-broadcast.protected.js` and update the message assigned to `notOnTheListMessage` (this will be sent to anyone who sends a message to the number that is not on the spreadsheet)\n\nNow you should be ready to deploy.\n\n- Deploy the project to Twilio Functions\n\n      npm run deploy\n\n- This will give you a URL where your function is hosted\n- Copy the URL and enter it as the Messaging webhook for the phone number you bought earlier and save the number\n\n#### Twilio Functions UI\n\n- Open the [Twilio Functions admin console](https://www.twilio.com/console/functions/manage)\n- Create a new blank Function\n- Name the Function \"Community SMS Broadcast\"\n- Give the Function a path, like `/community-sms-broadcast`\n- Check the _Access Control_ checkbox\n- Replace the code with the contents of `functions/community-sms-broadcast.protected.js` from this repo\n- [optional] In the code, update the message assigned to `notOnTheListMessage` (this will be sent to anyone who sends a message to the number that is not on the spreadsheet)\n- Save the Function\n- Open the [Twilio Functions Configuration console](https://www.twilio.com/console/functions/configure)\n- Check the box that says _Enable ACCOUNT_SID and AUTH_TOKEN_\n- Take the Google credentials JSON file you downloaded earlier and upload it as a private asset called `credentials.json`.\n- Open your Google Spreadsheet and look at the URL bar, it should look like `https://docs.google.com/spreadsheets/d/{GOOGLE_SPREADSHEET_KEY}/edit#gid=0`. Take the string that represents your `GOOGLE_SPREADSHEET_KEY` and enter that as an environment variable called `GOOGLE_SPREADSHEET_KEY`\n- In dependencies, enter `google-spreadsheet` with the version `3.0.10`\n- Save the configuration\n- Open your function again and find the full URL and path\n- Copy the URL and enter it as the Messaging webhook for the phone number you bought earlier and save the number\n\n### You're ready\n\nSend a text message to the Twilio number. It will be broadcast out to the other numbers on your spreadsheet (you might want to test this with just a couple of numbers first).\n\n## LICENSE\n\nMIT © Phil Nash\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilnash%2Fcommunity-sms-broadcast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilnash%2Fcommunity-sms-broadcast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilnash%2Fcommunity-sms-broadcast/lists"}