From 34be7c8d725c2712962f2fd7c6854d2b0290622d Mon Sep 17 00:00:00 2001
From: Karel van Klink <karel.vanklink@geant.org>
Date: Tue, 6 Aug 2024 10:00:23 +0200
Subject: [PATCH] Include environment name in notification email subject line

---
 gso/workflows/tasks/send_email_notifications.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gso/workflows/tasks/send_email_notifications.py b/gso/workflows/tasks/send_email_notifications.py
index e30916cc..f346cf1f 100644
--- a/gso/workflows/tasks/send_email_notifications.py
+++ b/gso/workflows/tasks/send_email_notifications.py
@@ -18,10 +18,10 @@ def gather_failed_tasks() -> State:
 @step("Send notification emails for all failed tasks")
 def send_email_notifications(state: State) -> None:
     """Send out an email notification for all tasks that have failed."""
-    base_url = load_oss_params().GENERAL.public_hostname
+    general_settings = load_oss_params().GENERAL
     all_alerts = ""
     for failure in state["failed_tasks"]:
-        failed_task_url = f"{base_url}/workflows/{failure["process_id"]}"
+        failed_task_url = f"{general_settings.public_hostname}/workflows/{failure["process_id"]}"
         failed_subscription = get_subscription_by_process_id(failure["process_id"])
         all_alerts = f"{all_alerts}------\n\n"
         if failed_subscription:
@@ -36,7 +36,7 @@ def send_email_notifications(state: State) -> None:
         )
 
     send_mail(
-        "GAP - One or more tasks have failed!",
+        f"GAP {general_settings.environment} environment - One or more tasks have failed!",
         (
             f"Please check the following tasks in GAP which have failed.\n\n{all_alerts}------"
             f"\n\nRegards, the GÉANT Automation Platform.\n\n"
-- 
GitLab