Track Telesign SMS successful delivery event
What does this MR do and why?
Implements a part of https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/468.
Context: we use Telesign to send phone number verification code to users through SMS and receive callbacks when delivery status is updated.
This MR introduces adds Snowplow tracking for Telesign SMS successful delivery events so we can track the delivery success rate. Country code is added as extra data so we can analyze success rate by country.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Setup Snowplow Micro
- Setup Telesign
$ rails c > ApplicationSetting.first.update(telesign_customer_xid: 'test_cust_id', telesign_api_key: 'test_api_key')
- Create a test
Users::PhoneNumberValidation
record$ rails c > FactoryBot.create(:phone_number_validation, telesign_reference_xid: '2557312299CC1304904080F4BE17BFB4')
- Send a test callback request
$ curl -X POST http://localhost:3000/-/phone_verification/telesign_callback -H 'Authorization: TSA test_cust_id:bqeIi0UHnk1inbM3rNGN1JoaPx8YVo7tNU6eOxCFsWY=' -H 'Content-Type: application/json' -d '{ "status": { "updated_on": "2016-07-08T20:52:46.417428Z", "code": 200, "description": "Sent" }, "errors": {}, "reference_id": "2557312299CC1304904080F4BE17BFB4" }'
- Validate that the event is tracked in Snowplow Micro (http://localhost:9090/micro/good)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Eugie Limpin