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

feat: Add twilio webhook endpoint for failed SMS deliveries #3110

Merged
merged 15 commits into from
Dec 6, 2021

Conversation

zatkiller
Copy link
Contributor

@zatkiller zatkiller commented Nov 29, 2021

Problem

Currently, there is no error handling for failed delivery of Twilio SMSes.

Closes #3103

Solution

Add a new endpoint which can be exposed to the Twilio Webhook status updates and logs any SMS failures

Features:

  • New endpoint at v3/notifications/twilio which logs the errors if SMS delivery status is failed or undelivered
  • Validation of request from Twilio using Twilio SDK

Tests

  • Update sms.service tests to include statusCallback
  • Add twilio.controller.spec.ts
  • Add notifications.route.spec.ts

@zatkiller zatkiller requested a review from karrui November 29, 2021 09:18
Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

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

some changes requested. Can we also add tests for the new API?

src/app/modules/twilio/twilio.controller.ts Outdated Show resolved Hide resolved
src/app/modules/twilio/twilio.controller.ts Outdated Show resolved Hide resolved
src/app/modules/twilio/twilio.service.ts Outdated Show resolved Hide resolved
src/app/modules/twilio/twilio.service.ts Outdated Show resolved Hide resolved
src/app/modules/twilio/twilio.controller.ts Outdated Show resolved Hide resolved
src/app/modules/twilio/twilio.controller.ts Outdated Show resolved Hide resolved
src/app/services/sms/sms.service.ts Outdated Show resolved Hide resolved
src/app/services/sms/sms.service.ts Outdated Show resolved Hide resolved
src/types/twilio.ts Show resolved Hide resolved
@zatkiller zatkiller requested a review from karrui December 1, 2021 09:23
@zatkiller zatkiller temporarily deployed to staging December 2, 2021 09:23 Inactive
@zatkiller zatkiller temporarily deployed to staging December 3, 2021 09:00 Inactive
Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

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

lgtm, a couple nits

src/app/modules/twilio/twilio.controller.ts Outdated Show resolved Hide resolved
src/app/services/sms/sms.service.ts Show resolved Hide resolved
@zatkiller zatkiller merged commit c1e499c into develop Dec 6, 2021
@zatkiller zatkiller deleted the feat/twilio-error-webhook branch December 6, 2021 04:52
@tshuli tshuli mentioned this pull request Dec 6, 2021
tshuli added a commit that referenced this pull request Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create endpoint for Twilio webhooks
2 participants