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: send SMS notification when submissions bounce #961

Merged
merged 43 commits into from
Jan 4, 2021

Conversation

mantariksh
Copy link
Contributor

@mantariksh mantariksh commented Dec 29, 2020

Problem

High operational workload due to need to contact email mode form admins when their form responses bounce.

Closes #903 and #949

Solution

Text form admins and collaborators at their emergency contact numbers when responses are lost, and when their forms are automatically deactivated due to permanent bounces.

Notifications for lost submissions are limited to one email and one SMS a day via the hasAutoEmailed and hasAutoSmsed fields in the Bounce collection. However, SMSes for form deactivation are sent every time the form is deactivated.

Tests

  • Create an email mode form and add one valid and one invalid (e.g. non-existent email address) email recipient. Add an editor as well as a read-only collaborator.
  • Submit the form and ensure that you do NOT receive any texts.
  • Replace the valid recipient with another invalid one. Submit the form and check that you AND the collaborator with write permissions receive two texts: one saying that a response has bounced, and another saying that your form was deactivated. ALL collaborators (including the read-only collaborator) should also receive an automated email. Check that each text has a corresponding document in the smscounts collection, with smsType as either BOUNCED_SUBMISSION or FORM_DEACTIVATED.
  • Reactivate the form and submit again. You and the collaborator with write permissions should receive only one text saying that the form was deactivated, and no emails.

@mantariksh mantariksh force-pushed the feat/admin-bounce-sms branch from 63c2647 to a0acde7 Compare December 29, 2020 10:41
@mantariksh mantariksh force-pushed the feat/admin-bounce-sms branch from a0acde7 to c7b99f3 Compare December 30, 2020 01:56
@mantariksh mantariksh force-pushed the feat/admin-bounce-sms branch from c7b99f3 to 10fa5e9 Compare December 30, 2020 02:22
@mantariksh mantariksh marked this pull request as ready for review December 30, 2020 03:33
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.

wew, big PR. lgtm with nits

src/app/modules/bounce/bounce.service.ts Outdated Show resolved Hide resolved
src/app/modules/form/form.utils.ts Outdated Show resolved Hide resolved
src/app/services/sms/sms.factory.ts Show resolved Hide resolved
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.

Admin SMS notification when form automatically deactivated and log nocontactnumber
2 participants