-
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
360Dialog WhatsApp #1645
360Dialog WhatsApp #1645
Conversation
- At the moment, we have some legacy clients with Twilio, but are planning to onboard new clients with 360dialog. We check if we have an 360dialog API key for the client to determine which implementation to use.
- request for more info - request to unsubscribe - request to re-subscribe
- it should be id, not external_id - handle error trying to create duplicate template name
- Fetch the existing templates and do not attempt to create a template with the same name to avoid predictable errors
- image/audio/video
- set client id
- namespace api_key setting in client
- DRY out the code by separating the two implementations of WhatsApp by business solution provider
- initialize setting, then save - use correct response code in handle_response
{ name: %i[first_name formatted_name last_name] }] }]) | ||
end | ||
|
||
def create_api_key_params |
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.
Could we maybe use a different controller for messaging and setup?
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.
Yeah, originally I added this in a separate controller, see 9468a86
(#1645)
I put it here because I wanted to differentiate between client/contributor onboarding, but maybe we could separate it again and rename it to WhatsApp::SetupController
, or something similar?
- We might want to create a new api key for any number of reasons. If the api key is exposed, for example.
- follow @roschaefer PR suggestion and simplify the code
This reverts commit 89ae62d.
- I added the automatic creation of a User as a contact person, when this is actually optional. We always create a contact person for an organization though, so maybe we should consider making this change in a different PR
- we experienced buggy behavior when the setting was intialized in a job where the value was not accessible to be queried using the syntax sugar Setting.three_sixty_dialog_client_api_key. Initializing with an empty string means the setting gets created on intialization of the server and we didn't run into an issue updating the value and accessing it straight away.
TODOS
Client onboarding
Configure instance for 360dialog WhatsApp
Send/receive messages
Testing
Replies
1. Process status webhook callback to save the whats_app_message_id
params[:statuses].first[:id]
2. When a contributor replies, we receive a context object with the message id, which can be used to lookup and/or display the message.
params[:messages].first[:context][:id]