Skip to content

Added more details in the email tracker. Redacts new information - #589

Open
fritzj2 wants to merge 18 commits into
developmentfrom
zhytkovd_fritzj2_#561
Open

Added more details in the email tracker. Redacts new information#589
fritzj2 wants to merge 18 commits into
developmentfrom
zhytkovd_fritzj2_#561

Conversation

@fritzj2

@fritzj2 fritzj2 commented Jun 22, 2026

Copy link
Copy Markdown

Issue Description

Fixes #561

  • The Development team wanted to collect more information from each email to better troubleshoot problems and errors.

Changes

  • Added recipientEmails to emailTracker. This tracks the emails of those who received the email.
  • template has been added in addition to the subject. The subject remains so as not to override existing data, and the old data functions without the additional fields.
  • Added body to the emailTracker. This stores the actual body text of the email that was sent to view any errors in the text.
  • emailHandler contains recipientEmails, template, and body when adding to the emailTracker object.
  • data-scrub.sql has 2 new lines to update any emailtracker objects when the database is dumped. This redacts emails and body text.
  • demo_data.py has an EmailTracker object built into the test data for faster testing of the emailTracker changes.

Testing

New information tracked

  • Shorthand, just send an email in some way, shape or form and then redact the information with the steps below
  • Import test data. Ensure the development environment is being used.
  • Use flask run to access the website.
  • Go to -> Administration -> Pending forms
  • Approve the test forum. This sends a sample email and is tracked in MySQL.
  • See further instructions below for accessing MySQL.

Redactions

  • Import the test data to get access to the test emailTracker object. Ensure you are in the development environment.
  • The data is stored in MySQL, open the MySQL terminal using mysql -u root -proot
  • If the command above doesn't run, add --skip-ssl at the end of it.
  • Once in the MySQL database, change the directory to lsf using USE lsf; in the MySQL terminal.
  • Use SHOW tables; to bring up a list of databases that MySQL has access to.
  • Use SELECT * FROM emailtracker; to bring up the list of data that the emailTracker has recorded so far. Ensure that the test data is present
  • After confirming the test data exists, data_scrub.sql needs to be changed for terminal support.
  • Add ; every time a line concludes with END. The data_scrub.sql shouldn't have the ; when the data is actually being backed up, but won't run in the terminal without them.
  • Once the ; are added, run source <filepath to data_scrub.sql>;. This will run the data_scrub.sql file and redact the data.
  • Check that the data has been redacted after scrubbing the data. (SELECT * FROM emailtracker;)

Comment thread app/models/emailTracker.py Outdated
Comment thread app/logic/emailHandler.py
Comment thread database/demo_data.py
@nahom70 nahom70 added epic A project that will require multiple sub-tasks to complete and removed epic A project that will require multiple sub-tasks to complete labels Jul 1, 2026
@MImran2002

Copy link
Copy Markdown
Contributor

As this is a database, back-end issue as well where we are working closely with redaacts and dumping data too. This would need a second reviewer. Go ahead and assign Brian to this too. @fritzj2

@fritzj2
fritzj2 requested a review from BrianRamsay July 7, 2026 20:34

@MImran2002 MImran2002 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure this doesn't fail on the production backup database so you will have insert sql commands in prod-backup.sql I believe for similar database change refer to Sara's CCE Minor production database fix: BCStudentSoftwareDevTeam/celts#1737 and more over don't delete the subject category unless Brian explicitly said so as we don't want the subject in the sever database to lose data as merging that will cause older data to be erase as we remove a data row from it.

@fritzj2

fritzj2 commented Sep 11, 2026

Copy link
Copy Markdown
Author

There is now support for prod-backup. The way it does this is by keeping the original fields, but adding the fields at the end which CAN be NULL as the previous data doesn't contain the rows.

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.

Store more detail in EmailTracker

4 participants