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

feat: switch stfc email to use status actions #711

Merged
merged 23 commits into from
Nov 4, 2024

Conversation

mutambaraf
Copy link
Contributor

@mutambaraf mutambaraf commented Aug 20, 2024

Description

This is a pull request to switch the STFC email to use status actions instead of the previously used method.

Motivation and Context

The previous method of handling STFC emails was cumbersome and prone to errors. There was also a need to clean up the code and improve readability. This change simplifies the email handling process and makes the code easier to maintain and understand.

Changes

The primary changes are done in two files: SMTPMailService.ts and stfcEmailHandler.ts.

  1. In SMTPMailService.ts, the variable _email has been renamed to emailTemplates for clarity and better readability.
  2. In stfcEmailHandler.ts, several unnecessary imports, functions, and variables have been removed. This significantly simplifies the file, making it easier to understand and maintain.
  3. The email handling process has been switched to use status actions, which simplifies the process and reduces the potential for errors.

How Has This Been Tested?

Fixes

Part of : UserOfficeProject/issue-tracker#1011

Depends On

https://git.devs.facilities.rl.ac.uk/isisbusapps/BisAppSettings/pulls/453

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@mutambaraf mutambaraf changed the title switch stfc email to use status actions feat: switch stfc email to use status actions Aug 20, 2024
@mutambaraf mutambaraf marked this pull request as ready for review August 20, 2024 14:13
@mutambaraf mutambaraf requested a review from a team as a code owner August 20, 2024 14:13
@mutambaraf mutambaraf requested review from William-Edwards-STFC, a team, bashanlam and bolmsten and removed request for a team August 20, 2024 14:13
@bolmsten
Copy link
Contributor

I think this is a good step. In the future it would be good to make the SMTP service less STFC specific, at the moment you have hardcoded values from STFC in the file.

@bolmsten
Copy link
Contributor

@gnyiri

Would be good to do the same for ELI and combine the SMTP services

@gnyiri
Copy link
Collaborator

gnyiri commented Aug 29, 2024

@gnyiri

Would be good to do the same for ELI and combine the SMTP services

We will probably not need our ELI specific SMTP service, the specialized event handler would be enough if the SMTP service will be generic without STFC specific code.

@mutambaraf
Copy link
Contributor Author

mutambaraf commented Sep 5, 2024

@gnyiri

Would be good to do the same for ELI and combine the SMTP services

I think the best way to solve this is to allow upload of email templates then query the table for uploaded templates. Will create an issue for it.

@bashanlam bashanlam merged commit 8db66de into develop Nov 4, 2024
19 checks passed
@bashanlam bashanlam deleted the uop-1011-switchover-to-status-actions-emails branch November 4, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants