Skip to content
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

Twilio integration v1 feature #680

Merged
merged 5 commits into from
Apr 2, 2021
Merged

Twilio integration v1 feature #680

merged 5 commits into from
Apr 2, 2021

Conversation

reichert621
Copy link
Collaborator

@reichert621 reichert621 commented Mar 24, 2021

This is the feature branch for the Twilio integration v1: #678

Phone Dashboard Slack
Screen Shot 2021-04-02 at 10 19 25 AM Screen Shot 2021-04-02 at 10 19 24 AM Screen Shot 2021-04-02 at 10 19 33 AM

@reichert621 reichert621 force-pushed the twilio-integration-v1 branch from 3d84567 to 8a76360 Compare April 1, 2021 16:58
reichert621 and others added 3 commits April 1, 2021 18:38
* Set up boilerplate for Twilio client

* Add migration for twilio authorizations

* Set up boilerplate UI for twilio authorization flow

* Improve error handling

* Add todos, fix warning

* Hide todo comment
* Send SMS notification via twilio

* Log error  if twilio sms fails

* Switch error to info

* Remove unused from test
* Added logic

* Added tests for context

* Added controller tests

* Pattern match param

* Removed whitespace

* Add inet6 back

* Add typespec

* Wrap test with describe

* Moved find_or_create_customer_and_conversation to Conversations context

* Mix format

* Cleanup typespec

* Log if twilio account is not found

* Log warn message if twilio account is not found

* Fix twilio controller test
@reichert621 reichert621 force-pushed the twilio-integration-v1 branch from 8a76360 to 4806ab9 Compare April 1, 2021 22:38
@reichert621 reichert621 marked this pull request as ready for review April 2, 2021 00:45
Messages.Message
}

@spec notify_sms(ChatApi.Messages.Message.t()) :: {:error, any} | {:ok, Tesla.Env.t()}
def notify_sms(%Message{
conversation_id: conversation_id,
body: body,
account_id: account_id,
customer: %Customer{phone: customer_phone}
Copy link
Contributor

@a8t a8t Apr 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious - looks like most of the refactor here was in order to move this into the with. Is that because we can't be sure that the customer is preloaded? @reichert621

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case, the message is coming from the agent/user, not the customer -- so customer here will be nil... we need to get the customer from the message's conversation instead :)

@reichert621
Copy link
Collaborator Author

thanks for the help on this @a8t @fmterrorf! 🎉 🎉 🎉

@reichert621 reichert621 merged commit fbe5e5c into master Apr 2, 2021
@reichert621 reichert621 deleted the twilio-integration-v1 branch April 2, 2021 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants