ActiveJob to send a new user notification to the PyBot
juliantrueflynn opened this issue · 1 comments
juliantrueflynn commented
Feature
Why is this feature being added?
Current ActiveJob sends new user event directly to Slack API. This logic instead can be handled entirely with PyBot.
What should your feature do?
Create ActiveJob to forward user events to PyBot. With user email and the user details like interests, mentor etc.
This task depends on ticket in PyBot to complete OperationCode/operationcode-pybot#67
apex-omontgomery commented
Acceptance criteria.
- Uses a shared token
slack_service_auth_token
- sends the following key value pairs from the users schema
t.string "email"
t.string "zip"
t.boolean "mentor", default: false
t.string "first_name"
t.string "last_name"
t.string "timezone"
t.text "bio"
t.string "state"
t.string "city"
t.boolean "volunteer", default: false
t.string "interests"
t.string "military_status"
- Retries only 5 times- faster failure and message
- Expects a simple status code and message. If bad status we have an error.
Final states:
- Success service returns -> user was invited
- Success service returns -> user not invited: `already_in_team
- Failure service returns -> any other status; force end job.
- Failure cannot access service; continue job tries