diff --git a/gso/workflows/tasks/send_email_notifications.py b/gso/workflows/tasks/send_email_notifications.py index e30916cc69ac75ca3114fd46ae94fb6ccf275f1f..f346cf1f5d14db2f1b00e9307ae22b83b609066d 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"