Mass Call and Email your Representatives via SMS
This repo contains code to make a civic-minded chatbot to mass call and email SF County Transportation Authority representatives using
You need three things:
- A Twilio account - sign up for a free one here and receive an extra $10 if you upgrade through this link
- A Twilio phone number with SMS capabilities - configure one here
- A SendGrid account - make one here
Test it out
Text +14153068517 something like a greeting or "don't defund muni".
Where does each file in this repo go to make bulk/mass calls and emails?
You need to make a Twilio Autopilot bot. Replace the code in the Greeting
task with the code in greeting.json
. Then make a task Call
and replace that JSON with the code in call.json
. That JSON task redirects to a Twilio Function that contains the JavaScript code in call.js
. It is there that calls are made to a JS object containing the SFCTA members and their phone #s, passing in a TwiML bin URL that contains the XML in call.xml
.
To email, make a task in your Autopilot bot console called email
and replace that JSON code with the code in email.json
. That redirects to a second Twilio Function that contains the JavaScript code in email.js
. email.js
also has the option to send an email receipt. Make a task in your Autopilot bot console called email_receipt
that contains the JSON code in email_receipt_collect.json
that asks if the user would like an email receipt and redirects to a third Twilio Function that contains the code in email_receipt_check.js
checking if they sent "yes" or "no". If they sent "no", they are given a list of resources. Else if they sent "yes", that Function then redirects to a different Autopilot task that contains the JSON in email_receipt_send.json
to ask for the user's email and redirects to a fourth and final Twilio Function that contains the code in email_receipt_send.js
.
Who is called and emailed?
The SF County Transportation Authority board. Many are also on the SF board of supervisors.
- Aaron Peskin, Chair of the San Francisco County Transportation Authority. Phone: +14155547450, email: [email protected].
- Rafael Mandelman, Vice Chair of SF CTA. Phone: +14155546968, email: [email protected].
- Dean Preston: phone: +14155547630, email: [email protected]
- Sandra Lee Fewer: phone: +14155547410, email: [email protected].
- Matt Haney. phone: +14155547970, email: [email protected].
- Gordon Mar. phone: +14155547460, email: [email protected]
- Hillary Ronen. phone: +14155545144, email: [email protected].
- Ahsha Safai. phone: +14155546975, email: [email protected].
- Catherine Stefani. phone: +14155547752, email: [email protected].
- Shamann Walton. phone: +14155547670, email: [email protected].
- Norman Yee. phone: +14155546516, email: [email protected].
- Vallie Brown. phone: 415-554-7630, email: [email protected].
Here's to more civic-minded tech, and saving mass public transit!