Unable to make Twillio work #336
Replies: 4 comments
-
Correct, Twilio won't look for a I like the idea of calling a PRs welcome. |
Beta Was this translation helpful? Give feedback.
-
@excid3 cool! I'll work on it at some point this week. |
Beta Was this translation helpful? Give feedback.
-
Chiming in my support for this. When the documented idiomatic way to construct messages for notifications is to have a |
Beta Was this translation helpful? Give feedback.
-
Easy override for anyone else coming along: use the deliver_by :twilio, credentials: :get_twilio_credentials, format: :twilio_formatted, debug: true
def twilio_formatted
{
From: get_twilio_credentials[:phone_number],
To: recipient.phone_number,
Body: message
}
end |
Beta Was this translation helpful? Give feedback.
-
Hi guys,
I do apologise if this has been raised before. I could only find #26 that relates to my problem, but it doesn't fix it.
Maybe I'm not understanding the documentation
My understanding is that by creating
Twillio should pick that message. It doesn't.
Looking at the code https://github.com/excid3/noticed/blob/master/lib/noticed/delivery_methods/twilio.rb#L17 I can't see where Noticed tries to call that method at all and instead its looking at
notification.params[:message]
I can fix this by doing either:
Body: notification.params[:message] || notification.message
or passing another value to:
::RefreshErrorNotification.with(resource: resource, error: e.to_s).deliver(user.partner)
ofmessage: "my twillio message here"
I personally would've thought that Noticed should automatically call the message method first and perhaps fallback to the message param or check if there is a param of message and then fallback to the message.
Am I doing something wrong?
Beta Was this translation helpful? Give feedback.
All reactions