-
Notifications
You must be signed in to change notification settings - Fork 528
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
Conversation
3d84567
to
8a76360
Compare
* 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
8a76360
to
4806ab9
Compare
lib/chat_api/twilio/notification.ex
Outdated
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} |
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.
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
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.
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 :)
thanks for the help on this @a8t @fmterrorf! 🎉 🎉 🎉 |
This is the feature branch for the Twilio integration v1: #678