Skip to content

Track Telesign SMS successful delivery event

Eugie Limpin requested to merge el-track-successful-sms-delivery-event into master

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

  1. Setup Snowplow Micro
  2. Setup Telesign
    $ rails c
    > ApplicationSetting.first.update(telesign_customer_xid: 'test_cust_id', telesign_api_key: 'test_api_key')
  3. Create a test Users::PhoneNumberValidation record
    $ rails c
    > FactoryBot.create(:phone_number_validation, telesign_reference_xid: '2557312299CC1304904080F4BE17BFB4')
  4. 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" }'
  5. Validate that the event is tracked in Snowplow Micro (http://localhost:9090/micro/good) Screenshot_2023-10-25_at_12.47.07_PM

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eugie Limpin

Merge request reports

Loading