Telephone Preference Service
The Telephone Preference Service (TPS) serves as the UK's sole official 'Do Not Call' register for both landlines and mobile numbers. It empowers individuals and businesses to opt out of receiving unsolicited live sales and marketing calls. Once a number is registered with the TPS, organisations are obligated by law to abstain from making calls to it.
The TPS Screener application retrieves a compilation of individuals who have completed registration through the TPS.
Subsequently, an FT service can leverage the TPS Screener to intelligently refine the list of recipients, ensuring that marketing communications are directed only to the appropriate individuals.
- Node ^22.x.x
- Doppler CLI if new to Doppler click to install the CLI.
To spin up the local instance of the production app, run the commands below:
-
Replace the start command with
"start:prod-from-local": "doppler run -p ft-tps-screener -c prod -- node app.js"
in package.json. -
Note: Ensure the start command is reverted to its original state before merge into prod.
-
Run
doppler login
command -
Run
npm run postinstall
command -
Run
npm run start
command
Enter a UK number in the browser's search bar; if it's registered, it's important to refrain from contacting for sales and marketing purposes.
-
There is currently no staging environment to test this app. However one may test the app running it locally with the command:
npm run start:dev
-
This will use the environment variables in the dev Doppler config.
-
Use
http://localhost:3000
to access TPS Screener.
ft-tps-screener
is hosted in AWS ECS via Hako in the CRM prod AWS account.
Production environment:
AWS Console – ECS Prod Cluster (crm-prod-eu-west-1
)
Look for the ft-tps-screener
service
Review environment:
AWS Console – ECS Review Cluster (crm-review-eu-west-1
)
Scheduled task configuration (EventBridge): AWS Console – EventBridge Schedules Filter for the app name to view or confirm scheduled job times.
The only scheduled task in ft-tps-screener is to run updateNumber.js
daily at 11pm UTC.
This is handled in AWS using EventBridge Scheduler, configured via the app.yaml in the scheduled-task stack.
Example:
scheduled-task:
type: scheduled-task
parameters:
TaskSchedule: "daily at 23:00"
How to change the schedule
-
Pull the repo and open:
hako-config/apps/ft-tps-screener/crm-prod-eu-west-1/app.yaml
-
Update the TaskSchedule under the scheduled-task stack.
-
Re-deploy using Hako:
Follow Login and Deploy steps 1 and 2.
-
If you're working on a PR or draft PR, it will automatically deploy to the review environment so you can validate the change.
-
Once validated, merge to master to apply the schedule in production.
-
Confirm the schedule in the AWS Console under: Amazon EventBridge → Schedules
For more detail on hako:
- See the CRM Hako Migration Guide
- Refer to the Hako Wiki
When you push your branch to the remote repo and a PR is opened (including draft PR), if CircleCI checks are successful, ft-tps-screener
is deployed to the AWS crm-review-eu-west-1 environment. We are not appending the PR number to the app name as with other configs due to a character limit when using Scheduled Task stacks:
Properties validation failed for TaskEventBridgeScheduler with message: [#/Name:expected maxLength: 64, actual: 68]
Once this is resolved/we have a workaround, we’ll use PR numbers in the app name.
Logging for the updateNumber.js
file is sent to Splunk from AWS. Functions in this file update the numbers stored in the email-platform-ftcom-tps
S3 bucket after checking TPS as necessary. Updates to numbers found are written to the ft-email_platform_tps_lookup
DynamoDB table.
updateNumber.js
runs everyday at 11pm as specified in the scheduler described above.
See the Splunk query below:
index=hako source="ft-tps-screener" host="ft-tps-screener.eu-west-1.crm-prod.ftweb.tech"
View errors using this search query
index="hako" source="ft-tps-screener" host="ft-tps-screener.eu-west-1.crm-prod.ftweb.tech" level="error"
There is currently no alerting for this app.
This system uses Change API to log changes to this app. A deployment will trigger a Change API alert in the #CRM Alerts Slack channel
Any merge to master will trigger a deployment to AWS ECS Prod cluster.