fix email notifications missing personalisation (notify-api-853) #854
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When we removed personalisation from the database, it worked fine for text messages, because all text messages were converted into jobs with one code flow and we could therefore always retrieve the personalisation from the CSV files.
However, there are a number of email notifications that do various unusual tasks (reset password, 90 day verification, invites, etc.). These are not jobs and have no CSV file containing the personalisation. So, we need to put the personalisation in redis so that it persists while the notification goes through the notification queue and awaits sending.
Security Considerations
We want to make sure potential PII in the personalizations doesn't linger around in redis forever, so we should use the one hour timeout (ex=60*60) option to make sure redis deletes stuff when it doesn't need it any longer.