-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onboarding new incoming messages #27
base: DEV_cv-1.1
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be good to have here as well is a non-technical explanation of how this system works. From looking at the code I see that it works in the following way:
- User sends a text to spoke.
- spoke replies back with onboarding_text.
- User is added to onboarding_campaign_id.
A few things that are unclear on how they are handled:
-
For a contact to be valid in spoke, it needs the following fields:
Firstname, Lastname, Cell, and Zipcode at a minimum.
I don't see in the code where the onboarding process asks for these fields or gets this data somehow. -
To comply with privacy laws, a user needs to explicitly tell us that we are allowed to text them. To do this when a user messages us, spoke should reply back with a text message like:
"Thanks for contacting us! Is it okay for a volunteer to text you? They won't see your phone number or personal information.
Respond with YES to keep receiving texts, or NO to Opt-Out."
The user than needs to respond with YES to be added to the campaign or NO to be added to the Opt-Out.
I don't see anywhere that this is happening. See the original issue for details:
#6
ONBOARDING_ASSIGNMENT_ID: num({ | ||
desc: | ||
"Assignment ID used by api/lib/twilio-incoming to onboard new contacts", | ||
default: undefined | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a suggestion, rather a question: Do you know what twilio/api/lib uses this for?
ie. I'm not sure what ID I would put here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the requirement of an assignment ID because of the following code:
When a message is received, an email is sent to the campaign user and this requires an assignment_id
- notification.js::handleMessageReceived
https://github.com/checkuponme/Spoke/blob/master/src/server/notifications.js#L167 - notification.js::sendUserNotification
https://github.com/checkuponme/Spoke/blob/master/src/server/notifications.js#L81 - send email about assignment
https://github.com/checkuponme/Spoke/blob/master/src/server/notifications.js#L135
This is a touches on a more general question about what are all the side effects for incoming/outgoing messages. If particular behaviors are expected, you should test that those also happen.
default: undefined | ||
}), | ||
ONBOARDING_TEXT: str({ | ||
desc: "User ID used by api/lib/twilio-incoming to onboard new contacts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description for this is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
desc: "User ID used by api/lib/twilio-incoming to onboard new contacts", | ||
default: undefined | ||
}), | ||
ONBOARDING_USER_ID: num({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be the userid of a blank dummy user created within spoke?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I am not totally clear on this. The messages table has a user_id on it, as does the assignments table. I assumed that this was the organization-level user.
No description provided.