Skip to content

[MDS-6632] - Email Tracking#3700

Merged
matbusby-fw merged 15 commits intodevelopfrom
mds-6632-email-tracking
Oct 17, 2025
Merged

[MDS-6632] - Email Tracking#3700
matbusby-fw merged 15 commits intodevelopfrom
mds-6632-email-tracking

Conversation

@matbusby-fw
Copy link
Copy Markdown
Collaborator

Objective

Implement the ability to track the status of emails that have sent through CHES.

  • Added a new table email_tracking
    • Created as a generic so this could be used by any other existing entity and referenced
    • Added Tracking for the status of the send, various timestamps and tracking ids
    • Tracks the template name if this is a template email and a reference_email_type for non templates
  • Added a celery task that will poll CHES for the status of email messages
  • Integrated the email_tracking into the email_service if a track_email boolean is passed when initiating a send
  • Updated documents flow for major applications so that it will only notify Minespace users of document updates once every 24 hours.

MDS-6632

Why are you making this change? Provide a short explanation and/or screenshots

…r recording email status and metadata.

- Added email tracking integration to email sending methods.
- Implemented CHES email status polling task to update email tracking records.
…UUID, removed `error_code`, and updated corresponding tests and scripts.
@matbusby-fw matbusby-fw force-pushed the mds-6632-email-tracking branch from 0d52217 to dcdb35f Compare October 9, 2025 19:50
@matbusby-fw matbusby-fw added the 👍 Ready for review Pull request has been double checked by the author and is ready for comments and feedback. label Oct 14, 2025
@taraepp
Copy link
Copy Markdown
Contributor

taraepp commented Oct 14, 2025

Overall it looks good to me! I have some nitpicks, which I suspect are more directed at copilot.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'bcgov-sonarcloud_mds_core-api'

Failed conditions
54.2% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@matbusby-fw matbusby-fw merged commit c3df500 into develop Oct 17, 2025
12 of 13 checks passed
@matbusby-fw matbusby-fw deleted the mds-6632-email-tracking branch October 17, 2025 16:54
matbusby-fw added a commit that referenced this pull request Oct 17, 2025
matbusby-fw added a commit that referenced this pull request Oct 17, 2025
Revert "[MDS-6632] - Email Tracking (#3700)"

This reverts commit c3df500.
matbusby-fw pushed a commit that referenced this pull request Oct 20, 2025
matbusby-fw added a commit that referenced this pull request Oct 20, 2025
Revert "[MDS-6632] - Revert Email Tracking (#3700) (#3709)"

This reverts commit 2c0309d.

Co-authored-by: mat <matbusby@gmail.com>
matbusby-fw added a commit that referenced this pull request Nov 5, 2025
* - Introduced email tracking model and associated migration scripts for recording email status and metadata.
- Added email tracking integration to email sending methods.
- Implemented CHES email status polling task to update email tracking records.

* Refactored email tracking model: replaced `ches_transaction_id` with UUID, removed `error_code`, and updated corresponding tests and scripts.

* Updated template email tracking default to false

* restore retries to sql migration

* update enum values

* remove import

* more enum fixes

* fixed missing comma

* fixed irt test

* fixed application_emails test

* fixed application_emails test

* address PR comments.  Set email tracking to always be done.  Updated a column type and a column name in the email_tracking table.  Created a shared TaskBase.  Updated celery task to be created with 'retry' rather than apply_async.

* removed not null from email tracking reference id and table

* removed not null from email tracking reference id and table

* Add `db_session` to email service integration test parameters

---------

Co-authored-by: mat <matbusby@gmail.com>
matbusby-fw added a commit that referenced this pull request Nov 5, 2025
Revert "[MDS-6632] - Email Tracking (#3700)"

This reverts commit c3df500.
matbusby-fw added a commit that referenced this pull request Nov 5, 2025
Revert "[MDS-6632] - Revert Email Tracking (#3700) (#3709)"

This reverts commit 2c0309d.

Co-authored-by: mat <matbusby@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👍 Ready for review Pull request has been double checked by the author and is ready for comments and feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants