getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
38.59k stars 4.13k forks source link

Twilio integration : Allow Alphanumeric Sender ID #25535

Open Gregory-Widmer opened 3 years ago

Gregory-Widmer commented 3 years ago

Summary

Allow using instead of a phone number an alphanumeric sender ID for Twilio.

Motivation

It's useful to hide the phone number and prevent replies on a SMS. It's basically a customization feature, but I don't think it requires many changes.

Additional Context

See some twilio doc about it.

Basically, when making a request, we only need to put an Alphanumeric sender ID instead of the phone number. Setting the "From" value to a sender ID like this would be a nice feature.

Here is a screenshot from my self-hosted Sentry of what it could look like.

image

When we provide a sender ID, we get the following error on test.

image

On the API request, we just need to replace the "From" data value by the Sender ID, like this (Exemple with curl) :

curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages.json \
-d "Body=The body goes here" \
-d "To=<My awesome phone number>" \
-d "From=Sentry" \
 -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:auth_token'

By replacing phone number validation by Sender ID or phone number validation, we should be able to allow this feature.

Thanks for reading.

BYK commented 3 years ago

Pinging @getsentry/workflow for triage. Also ping to @getsentry/ecosystem in case this falls into their court.

devtanna commented 3 years ago

I see the Twilio docs support this as correctly mentioned in the description. https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id

I can try to work on this if this is indeed an intended use case :)

CC: @jonesphillip

jonesphillip commented 3 years ago

@devtanna looks like that's right. Another example here: https://support.twilio.com/hc/en-us/articles/223133967-Change-the-From-number-or-Sender-ID-for-Sending-SMS-Messages

Are you still interested in working on this?

devtanna commented 3 years ago

@jonesphillip I have opened a PR for initial review :) Please let me know if I have missed anything.