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

Bounce rate limit notifications when a client's service is suspended. #1717

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

whabanks
Copy link
Contributor

@whabanks whabanks commented Jan 3, 2023

Summary | Résumé

Plumbing and initial implementation of notifications sent to clients when their service is manually suspended. Email contents are placeholders for now. Additional work to be done once the ADR for bounce rate emails is complete and we have a more complete picture regarding warning emails when a service is approaching it's bounce rate limit, and when automatic suspension takes place.

Test instructions | Instructions pour tester la modification

With an admin account, suspend a service and note that an email is sent to the service owner informing them of the suspension

Release Instructions | Instructions pour le déploiement

Reviewer checklist | Liste de vérification du réviseur

This is a suggested checklist of questions reviewers might ask during their
review | Voici une suggestion de liste de vérification comprenant des questions
que les réviseurs pourraient poser pendant leur examen :

  • Is the code maintainable? | Est-ce que le code peut être maintenu?
  • Have you tested it? | L’avez-vous testé?
  • Are there automated tests? | Y a-t-il des tests automatisés?
  • Does this cause automated test coverage to drop? | Est-ce que ça entraîne
    une baisse de la quantité de code couvert par les tests automatisés?
  • Does this break existing functionality? | Est-ce que ça brise une
    fonctionnalité existante?
  • Does this change the privacy policy? | Est-ce que ça entraîne une
    modification de la politique de confidentialité?
  • Does this introduce any security concerns? | Est-ce que ça introduit des
    préoccupations liées à la sécurité?
  • Does this significantly alter performance? | Est-ce que ça modifie de
    façon importante la performance?
  • What is the risk level of using added dependencies? | Quel est le degré de
    risque d’utiliser des dépendances ajoutées?
  • Should any documentation be updated as a result of this? (i.e. README
    setup, etc.) | Faudra-t-il mettre à jour la documentation à la suite de ce
    changement (fichier README, etc.)?

@whabanks whabanks force-pushed the bounce-rate-notifications branch 2 times, most recently from 3c53036 to d2af0d2 Compare January 3, 2023 18:58
@whabanks whabanks force-pushed the bounce-rate-notifications branch from d2af0d2 to 6613cad Compare January 4, 2023 18:52
- Update db migrations
- Add test for service resume notification
- Add new draft email content
"An email may bounce if:",
"",
"(1) The recipient or their email provider has blocked sends from your service.",
"(2) You send to an email address that does not exist." "",

Check warning

Code scanning / CodeQL

Implicit string concatenation in a list

Implicit string concatenation. Maybe missing a comma?
"type": "email",
"subject": "Your bounce rate has exceeded 5%",
"content_lines": [
"Hello ((name))," "",

Check warning

Code scanning / CodeQL

Implicit string concatenation in a list

Implicit string concatenation. Maybe missing a comma?
Comment on lines +48 to +49
"The bounce rate has exceeded 5% for “((service_name))”. You should update your list of recipient’s email addresses."
"",

Check warning

Code scanning / CodeQL

Implicit string concatenation in a list

Implicit string concatenation. Maybe missing a comma?
Comment on lines +56 to +57
"To maintain our operations, we’ll suspend the service if its bounce rate reaches 10%. While the service is under suspension, it will not be able to send email or text messages."
"",

Check warning

Code scanning / CodeQL

Implicit string concatenation in a list

Implicit string concatenation. Maybe missing a comma?
"content_lines": [
"Hello ((name)),",
"",
"“((service_name))” can send messages again. We’ve removed the suspension." "",

Check warning

Code scanning / CodeQL

Implicit string concatenation in a list

Implicit string concatenation. Maybe missing a comma?
mocker, sample_service, admin_request, bounce_rate_suspend_resume_templates
):
# TODO
mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async")

Check notice

Code scanning / CodeQL

Unused local variable

Variable mocked is not used.
# TODO
mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async")

response = admin_request.post(

Check notice

Code scanning / CodeQL

Unused local variable

Variable response is not used.
_expected_status=204,
)

notification = Notification.query.first()

Check notice

Code scanning / CodeQL

Unused local variable

Variable notification is not used.
)

notification = Notification.query.first()
service = Service.query.get(sample_service.id)

Check notice

Code scanning / CodeQL

Unused local variable

Variable service is not used.
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.

1 participant