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

Map country code to different Twilio resources #1976

Merged
merged 16 commits into from
May 25, 2023

Conversation

mderynck
Copy link
Contributor

@mderynck mderynck commented May 19, 2023

Many countries are introducing different requirements for SMS senders to register and/or use alpha numeric ids, short codes or regional numbers or face being blocked. The changes in this PR will give us more flexibility by allowing us to map to different resources in Twilio based on the phone number we are trying to reach. For this first implementation the selection is made based on country code of the recipient. Verification and phone calls were given the same treatment although the immediate need is for SMS. Senders with no country code set can be used as catch-all defaults. This also falls back to the configured live settings/environment variables if not configured.

Possible future additions:

  • Move through list of trying multiple senders before failing notification
  • Easily expanded to allow per-organization or per-user resources to let users and tenants configure their own Twilio
  • Add UI + replace live settings so users can configure their own settings
  • More selection criteria if needed

TODO:

@mderynck mderynck added the pr:no public docs Added to a PR that does not require public documentation updates label May 23, 2023
@mderynck mderynck marked this pull request as ready for review May 23, 2023 22:09
@mderynck mderynck requested a review from a team May 23, 2023 22:09
Copy link
Contributor

@matiasb matiasb left a comment

Choose a reason for hiding this comment

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

LGTM, one minor suggestion.

engine/apps/twilioapp/phone_provider.py Outdated Show resolved Hide resolved
@mderynck mderynck added this pull request to the merge queue May 25, 2023
Merged via the queue into dev with commit ae7561a May 25, 2023
@mderynck mderynck deleted the mderynck/twilio-alphanumeric-sender branch May 25, 2023 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:no public docs Added to a PR that does not require public documentation updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants