Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIMS-2132: Fields included in the notification emails #2727

Merged
merged 3 commits into from
Oct 17, 2024
Merged

Conversation

LawrenceLau2020
Copy link
Collaborator

@LawrenceLau2020 LawrenceLau2020 commented Oct 16, 2024

🎯 Summary

PIMS-2132

Changes

  • Added the property's location ("Site Location") into the email template notifications for projects that have been either "Submitted" or "Approved for ERP".

Testing

  • Need to test 2 different project statuses which use these templates: "Submitted & "Approved for ERP".
  • If PIMS-1946 Cancel/Stop Notifications #2726 hasn't been merged to dev yet, open any project that has already been "submitted" and change the status back to "Submitted" or back to "Approved for ERP" to trigger the email notifications.
    • You should be able to see the new line displaying the property's City, located under "Site Address" in the email notification.
  • You could also create a new project and submit it.
  • Afterwards, you can also change the status to "Approved for ERP" and check that the "Site Location" is included in the email notifications.
  • Testing the rollback can be optional, but might be a good idea to see that it works.
    • For this you can either review the body column of the notifications table in the database, and/or trigger the above notifications again.

🔰 Checklist

  • I have read and agree with the following checklist and am following the guidelines in our Code of Conduct document.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation where required.
  • I have tested my changes to the best of my ability.
  • My changes generate no new warnings.

Copy link

🚀 Deployment Information

The Express API Image has been built with the tag: 2727. Please make sure to utilize this specific tag when promoting these changes to the TEST and PROD environments during the API deployment. For more updates please monitor Image Tags Page on Wiki.

Copy link

codeclimate bot commented Oct 17, 2024

Code Climate has analyzed commit 0d25145 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 93.4%.

View more on Code Climate.

'Site Address: {{ property.Address1 }}<br>' || chr(10) || chr(9) || chr(9) || chr(9) || chr(9) || chr(9) || 'Site Location: {{ property.AdministrativeArea.Name }}<br>',
'g') -- 'g' to replace all instances within a template
WHERE body LIKE '%Site Address: {{ property.Address1 }}' || chr(10) || '%<br>%' AND id = 1`);
await queryRunner.query(`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There didn't seem to be a way to do a global search and replace based on the differences in formatting in template id=1, so had to split it up into 2 separate queries.

Copy link
Collaborator

@dbarkowsky dbarkowsky left a comment

Choose a reason for hiding this comment

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

Tested in both directions. Migrates and reverts successfully.
The Site Location line is nicely formatted in all cases.
Thank you for updating the nunjucks templates too.

@LawrenceLau2020 LawrenceLau2020 merged commit a27b02a into main Oct 17, 2024
7 checks passed
@LawrenceLau2020 LawrenceLau2020 deleted the PIMS-2132 branch October 17, 2024 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

2 participants