From 92c0cb5e0c94127cde1926180d595c89be0ff9f1 Mon Sep 17 00:00:00 2001 From: Cameron Lamb Date: Fri, 30 Aug 2024 16:33:49 +0100 Subject: [PATCH] We no longer send the email about security clearances to CLU4 (#472) - Stop sending the email about updating security clearances to CLU4 - Rename the function to be task oriented - Rename the mappings - Don't change the env vars --- core/notify.py | 2 +- docs/technical-documentation/emails.md | 2 +- leavers/utils/emails.py | 11 ++++------- leavers/workflow/leaving.py | 2 +- leavers/workflow/tasks.py | 6 +++--- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/core/notify.py b/core/notify.py index 799df11c4..f09f84540 100644 --- a/core/notify.py +++ b/core/notify.py @@ -44,7 +44,7 @@ class EmailTemplates(Enum): email_template_settings.LINE_MANAGER_OFFLINE_SERVICE_NOW_EMAIL ) - CLU4_LEAVER_EMAIL = email_template_settings.CLU4_EMAIL + SECURITY_CLEARANCE_LEAVER_EMAIL = email_template_settings.CLU4_EMAIL FEETHAM_SECURITY_PASS_OFFICE_EMAIL = ( email_template_settings.FEETHAM_SECURITY_PASS_OFFICE_EMAIL ) diff --git a/docs/technical-documentation/emails.md b/docs/technical-documentation/emails.md index 57abcfebb..976e31cb9 100644 --- a/docs/technical-documentation/emails.md +++ b/docs/technical-documentation/emails.md @@ -35,7 +35,7 @@ These are notification emails sent to the processor: | Email name | Template ID Environment Variable | Context/Notes | | ----- | ----- | ----- | -| CLU4 Leaver Notification Email | TEMPLATE_ID_CLU4_EMAIL | This email is sent to CLU4 to inform them of the leaver. | +| Security Clearance Leaver Email | TEMPLATE_ID_CLU4_EMAIL | This email is sent vetting to inform them of the leaver. | | Feetham Security Pass Office Leaver Notification Email | TEMPLATE_ID_FEETHAM_SECURITY_PASS_OFFICE_EMAIL | This email is sent to the Feetham Security Pass Office to inform them of the leaver and their reported assets. | | IT Ops Leaver Notification Email | TEMPLATE_ID_IT_OPS_ASSET_EMAIL | This email is sent to the IT Ops team to inform them of the leaver and their reported assets. | | OCS Leaver Notification Email | TEMPLATE_ID_OCS_LEAVER_EMAIL | This email is sent to OCS to inform them of the leaver. | diff --git a/leavers/utils/emails.py b/leavers/utils/emails.py index b205fc7f4..313f14f0c 100644 --- a/leavers/utils/emails.py +++ b/leavers/utils/emails.py @@ -219,25 +219,22 @@ def send_leaver_not_in_uksbs_reminder( ) -def send_clu4_leaver_email( +def send_security_clearance_leaver_email( leaving_request: LeavingRequest, template_id: Optional[notify.EmailTemplates] = None, ): """ - Send Cluster 4 Email to notify of a new leaver. + Send email to get security clearances updated. """ - if not settings.CLU4_EMAIL: - raise ValueError("CLU4_EMAIL is not set") - if not settings.SECURITY_TEAM_VETTING_EMAIL: raise ValueError("SECURITY_TEAM_VETTING_EMAIL is not set") personalisation = get_leaving_request_email_personalisation(leaving_request) notify.email( - email_addresses=[settings.CLU4_EMAIL, settings.SECURITY_TEAM_VETTING_EMAIL], - template_id=notify.EmailTemplates.CLU4_LEAVER_EMAIL, + email_addresses=[settings.SECURITY_TEAM_VETTING_EMAIL], + template_id=notify.EmailTemplates.SECURITY_CLEARANCE_LEAVER_EMAIL, personalisation=personalisation, ) diff --git a/leavers/workflow/leaving.py b/leavers/workflow/leaving.py index d80202b22..2dba0b0e2 100644 --- a/leavers/workflow/leaving.py +++ b/leavers/workflow/leaving.py @@ -218,7 +218,7 @@ "are_all_tasks_complete", ], task_info={ - "email_id": EmailIds.CLU4_EMAIL.value, + "email_id": EmailIds.SECURITY_CLEARANCE_EMAIL.value, }, ), # OCS diff --git a/leavers/workflow/tasks.py b/leavers/workflow/tasks.py index bfb00d578..21e581ab7 100644 --- a/leavers/workflow/tasks.py +++ b/leavers/workflow/tasks.py @@ -24,7 +24,6 @@ from leavers.utils.emails import ( get_leaving_request_email_personalisation, send_buisness_continuity_leaver_email, - send_clu4_leaver_email, send_comaea_email, send_feetham_security_pass_office_email, send_health_and_safety_email, @@ -40,6 +39,7 @@ send_line_manager_thankyou_email, send_ocs_leaver_email, send_ocs_oab_locker_email, + send_security_clearance_leaver_email, send_security_team_offboard_bp_leaver_email, send_security_team_offboard_rk_leaver_email, ) @@ -426,7 +426,7 @@ class EmailIds(Enum): FEETHAM_SECURITY_PASS_OFFICE_EMAIL = "feetham_security_pass_office_email" IT_OPS_ASSET_EMAIL = "it_ops_asset_email" - CLU4_EMAIL = "clu4_email" + SECURITY_CLEARANCE_EMAIL = "clu4_email" OCS_EMAIL = "ocs_email" OCS_OAB_LOCKER_EMAIL = "ocs_oab_locker_email" HEALTH_AND_SAFETY_EMAIL = "health_and_safety_email" @@ -448,7 +448,7 @@ class EmailIds(Enum): EmailIds.SECURITY_OFFBOARD_RK_LEAVER_NOTIFICATION: send_security_team_offboard_rk_leaver_email, EmailIds.FEETHAM_SECURITY_PASS_OFFICE_EMAIL: send_feetham_security_pass_office_email, EmailIds.IT_OPS_ASSET_EMAIL: send_it_ops_asset_email, - EmailIds.CLU4_EMAIL: send_clu4_leaver_email, + EmailIds.SECURITY_CLEARANCE_EMAIL: send_security_clearance_leaver_email, EmailIds.OCS_EMAIL: send_ocs_leaver_email, EmailIds.OCS_OAB_LOCKER_EMAIL: send_ocs_oab_locker_email, EmailIds.HEALTH_AND_SAFETY_EMAIL: send_health_and_safety_email,