Skip to content
Snippets Groups Projects

Feature/send validation emails

Merged Karel van Klink requested to merge feature/send-validation-emails into develop
All threads resolved!
@@ -23,14 +23,16 @@ def send_email_notifications(state: State) -> None:
for failure in state["failed_tasks"]:
failed_task_url = f"{base_url}/workflows/{failure["process_id"]}"
failed_subscription = get_subscription_by_process_id(failure["process_id"])
all_alerts += "------\n\n"
all_alerts = f"{all_alerts}------\n\n"
if failed_subscription:
all_alerts += (
f"Product name: {failed_subscription.product.name}\nDescription: {failed_subscription.description}\n"
all_alerts = (
f"{all_alerts}Product name: {failed_subscription.product.name}\n"
f"Description: {failed_subscription.description}\n"
)
all_alerts += (
f'The step "{failure["last_step"]}" failed for the following reason: "{failure["failed_reason"]}".\n\n'
f'Please inspect the full workflow at the following link: {failed_task_url}.\n\n'
all_alerts = (
f'{all_alerts}The step "{failure["last_step"]}" failed for the following reason: '
f'"{failure["failed_reason"]}".\n\nPlease inspect the full workflow at the following link: '
f'{failed_task_url}.\n\n'
)
send_mail(
Loading