Send email notifications when a token becomes expired.
Review Request #12591 — Created Sept. 12, 2022 and submitted — Latest diff uploaded
Currently, users do not get notified about expired tokens. With this change, an
email is sent the first time an expired token is used. The email describes when
the token expired and how to create new tokens. If the email was successfully
sent, any subsequent uses of the token do not trigger another email.
This change also fixes up all of the API token email templates by adding date
formatting and fixing some missing URLs. The tests for the templates were also
- Created unit tests for the expired token emails and ran unit tests in
- Manually tested authenticating with expired and non expired tokens, confirmed
that appropriate emails were sent.