Twin-Cities-Mutual-Aid / twin-cities-aid-distribution-locations

A webapp to coordinate aid and care in the Twin Cities.
44 stars 31 forks source link

Investigate outbound Twilio possibilities #85

Open mc-funk opened 4 years ago

mc-funk commented 4 years ago

There are two use cases for outbound texts that the TCMAP team wants to look into:

  1. being able to respond to folks who send us information. Not sure what this looks like on the process side, but if you can let us know the possibilities, we can get that figured out.

  2. Stretch goal: being able to send out reminders, preferably automated, to sites that have subscribed.

    • our vision is to send out a rotating set of reminders no more than daily, which include self-care messages such as "Have you drank water recently? Also, please remember to update us on your site's needs and hours. Thanks for all you do!" (we can get a list of these that are better than that). This is inspired by our reminders in the TCMAP #love-and-support channel which we lovingly call "Robot Dad". - This would need all the standard opt out options or we would need to select who gets them so that we're not spamming people who don't want them. I'm not sure how that fits in to all our various considerations e.g. budget, feasibility, whether twilio is the appropriate tool for this.
maxine commented 4 years ago

@mc-funk after some investigation, I have an Apps Script all set up so that you can send messages from the Twilio phone number by putting the message in Google Sheets (based on this tutorial). I can put that in the main Google Spreadsheet whenever! This can be used for reminders or for direct replies to people (and I can set those two spreadsheets up separately).

mc-funk commented 4 years ago

Wow, that's sooooo cool!! I will surface that back to the group, it'll require some training and decision-making on the spreadsheet side of things, but awesome potential and I really appreciate it!!!

andyinabox commented 4 years ago

@maxine can we add the script to https://github.com/Twin-Cities-Mutual-Aid/community-map-google-scripts ?

maxine commented 4 years ago

@andyinabox good call! See PR here.

maxine commented 4 years ago

Can also add anyone to the Twilio account and/or share login info

maxine commented 4 years ago

Update on this: we've added the ability to text back people who send us information 👍

@mc-funk, Twilio would definitely work for automated reminders as well. Regarding opt-out options, from Twilio's page on unsubscribing from messages:

STOP, STOPALL, UNSUBSCRIBE, CANCEL, END, or QUIT: Any of these STOP keyword replies will prevent a customer from receiving new messages from the Twilio phone number they're responding to.

We could have a separate phone number (phone2) that sends out the automated reminders so that even if someone unsubscribes from the reminders, we can still text them back individually if they send in information.

To get people to subscribe to the reminders, we can re-respond to folks who have previously sent information to the phone number we're currently using via the "texts" spreadsheet response workflow and prompt them to text phone2 in order to opt into reminders.

If folks feel ready to add the reminders and can send me a list, I can set this up whenever!

mc-funk commented 4 years ago

Awesome @maxine ! 1) I need to find the time to make an issue on this but the people testing this on the data entry side (@comeoneileen and co) were seeing some issues:

Incoming texts don't appear on the spreadsheet and the READY doesn't turn into another status, so outgoing texts keep getting fired out repeatedly.

I haven't had time to be able to replicate but if this is something you have time to look at today that'd be amazing. Sorry for the slapdash "throw it in a comment" thing, dayjob is dayjob :P

2) The context on the reminder stuff is super helpful!! I think we are still going back and forth on the usefulnes and process of reminder-y things on our end.

comeoneileen commented 4 years ago

@maxine - in theory the idea of an automated response is a good one, but in practice, I'd rather get my team trained to answer texts fast enough that it's not necessary. We have folks monitoring incoming info and updating the map live from 8a-11p every day. How hard would it be to make the auto-response only happen between 11p and 8a (along the lines of "got your text, will respond when we're back on at 8am")?

maxine commented 4 years ago

Working on both of these issues now – @mc-funk I'm seeing all the new inbound texts received in my local test spreadsheet, but when I went to check out the App Script in the shared spreadsheet, I saw the following error:

Screen Shot 2020-06-10 at 3 44 38 PM

Any idea if this is an us thing or a Google thing? This may be why stuff isn't running properly.

mc-funk commented 4 years ago

@maxine we've locked down permissions in the last couple of days so I think I need a gmail from you before you'll be able to edit the script again!

maxine commented 4 years ago

The outbound texts are also working on my test spreadsheet. I'm wondering if there's a permissions issue that isn't letting the script modify the spreadsheet? I authorized the script to edit the spreadsheet, but if I don't have enough access power to the sheet anymore, that could be the issue.

To check the permissions, can someone who is the owner of the doc visit their Google permissions page and see if the script is listed? I think it's called "Send and Receive Texts" or someting similar (Info from this page on Authorization for Google Services)

maxine commented 4 years ago

ah! Yes @mc-funk slacking you now

maxine commented 4 years ago

Sending/receiving issue was due to changed permissions and is fixed!

@comeoneileen I'm setting up a time-based auto-response to test out tonight and will let you know tomorrow 😄

comeoneileen commented 4 years ago

Awesome. Thank you so much! This is going to be an incredible tool and we are excited and grateful for your work on it :)

maxine commented 4 years ago

@mc-funk @comeoneileen created a PR describing changes to enable offline auto-responses in the community-map-google-scripts repository. Hopping offline for an hour or so, but let me know what you think when you have a chance and I can make any adjustments today before adding it to the spreadsheet.