-
Notifications
You must be signed in to change notification settings - Fork 17
How notifications work
Kai Hendry edited this page Feb 21, 2019
·
3 revisions
Make notifications useful to the end user
https://media.dev.unee-t.com/2019-02-21/notification-overview.mp4
- Certain database changes trigger CALL mysql.lambda_async to https://github.com/unee-t/lambda2sns
- JSON payload relayed to https://case{{STAGE}}.unee-t.com/api/db-change-message/process?accessToken={{API_ACCESS_TOKEN}} via the lambda function
- https://github.com/unee-t/frontend/blob/master/imports/api/rest/post-process-db-change-message.js
- Payloads are inserted into Frontend DB Mongo's messagePayloads
- https://case.dev.unee-t.com/notification-settings determines whether user opted out. Also user must have verified email.
- Email is sent
https://github.com/unee-t/ses2case is a lambda function that takes AWS SES delivery reports and basically tells frontend whether to mark the email as unverified again, to prevent emails.
https://github.com/unee-t/frontend/labels/notifications
- since we rely on lambda functions, it is largely impossible to test end to end locally or replicate with an AWS account
- to setup up the lambdas even if have your own AWS account. Permissions are rather painful and there are lot of nuances. There are some tests: https://github.com/unee-t/lambda2sns/tree/master/tests
- You can locally simulate messages if you know the payloads. Hint: Study messagePayloads for a template and use Postman!
- this is very hard to test end to end. For example on the test system you must make sure you have a Bugzilla ID with your own email, in order to receive the messages in order to verify the notification is what you expect it to be
- it's difficult for users to actually understand the value of each notification type or how it was generated / came to be
- it typically takes several hours to rule a email recipient as failing, providing their SMTP actually tell AWS SES
Last but not least, we do have a way to measure if users engaged with a notification https://github.com/unee-t/engagement
However can we say that if a user doesn't engage with the URL, the notification was ineffective? Some people might just be reading updates via email.