This PR adds the Twilio SMS API library, in order to send volunteers a "Thank You" text message upon task completion.
Airtable Schema Updates
Two new fields are created in the Requests table:
Followup SMS Sent?: tracks whether the volunteer has been sent a followup text upon task completion.
Last modified time: tracks when the Status field was last updated. This is necessary to select only request records that have been marked Completed in the last day, so as to avoid sending a text to all volunteers who have completed a task ever and possibly overloading the system.
Dependencies Updates
Two new dependencies are added:
twilio: Twilio API library
phone: library to normalize mobile numbers into E.164 format, as required by Twilio.
Node Environment Variable Updates
Three new environment variables are added:
TWILIO_ACCOUNT_SID
TWILIO_AUTH_TOKEN
TWILIO_PHONE_NUMBER
Testing
In order to test the text message functionality, follow these steps:
In your copy of Airtable, set the value of Followup SMS Sent? to Yes for all records with a Status of Completed
Choose the most recently completed request record, and update the corresponding volunteer's phone number in the volunteers table with your personal/testing number
If the most recently completed request was completed more than a day ago, change the value of Status to one of the other options, then change it back to Completed. This will update Last modified time
Set Followup SMS Sent? to No for the most recently completed request record
This PR adds the Twilio SMS API library, in order to send volunteers a "Thank You" text message upon task completion.
Airtable Schema Updates
Two new fields are created in the
Requests
table:Followup SMS Sent?
: tracks whether the volunteer has been sent a followup text upon task completion.Last modified time
: tracks when theStatus
field was last updated. This is necessary to select onlyrequest
records that have been markedCompleted
in the last day, so as to avoid sending a text to all volunteers who have completed a task ever and possibly overloading the system.Dependencies Updates
Two new dependencies are added:
twilio
: Twilio API libraryphone
: library to normalize mobile numbers into E.164 format, as required by Twilio.Node Environment Variable Updates
Three new environment variables are added:
TWILIO_ACCOUNT_SID
TWILIO_AUTH_TOKEN
TWILIO_PHONE_NUMBER
Testing
In order to test the text message functionality, follow these steps:
Followup SMS Sent?
toYes
for all records with aStatus
ofCompleted
request
record, and update the corresponding volunteer's phone number in thevolunteers
table with your personal/testing numberrequest
was completed more than a day ago, change the value ofStatus
to one of the other options, then change it back toCompleted
. This will updateLast modified time
Followup SMS Sent?
toNo
for the most recently completedrequest
recordConsole
Followup SMS