Skip to content

Commit

Permalink
We no longer send the email about security clearances to CLU4 (#472)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
CamLamb committed Aug 30, 2024
1 parent 688c1c0 commit 92c0cb5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion core/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
2 changes: 1 addition & 1 deletion docs/technical-documentation/emails.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
11 changes: 4 additions & 7 deletions leavers/utils/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down
2 changes: 1 addition & 1 deletion leavers/workflow/leaving.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
"are_all_tasks_complete",
],
task_info={
"email_id": EmailIds.CLU4_EMAIL.value,
"email_id": EmailIds.SECURITY_CLEARANCE_EMAIL.value,
},
),
# OCS
Expand Down
6 changes: 3 additions & 3 deletions leavers/workflow/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
)
Expand Down Expand Up @@ -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"
Expand All @@ -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,
Expand Down

0 comments on commit 92c0cb5

Please sign in to comment.