From 9b1866a30bf1c244d4dc6876b50a20b14f485df4 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Wed, 20 Nov 2024 11:04:31 -0600 Subject: [PATCH] Add project link in renewal email --- allocations/tasks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/allocations/tasks.py b/allocations/tasks.py index 86894fa3..2665bf34 100644 --- a/allocations/tasks.py +++ b/allocations/tasks.py @@ -13,6 +13,7 @@ from django.forms.models import model_to_dict from django.utils import timezone from django.utils.html import strip_tags +from django.urls import reverse from keycloak.exceptions import KeycloakClientError from allocations.models import Allocation, Charge @@ -60,13 +61,14 @@ def _send_expiration_warning_mail(alloc, today): f"day{'s' if time_until_expiration.days != 1 else ''}" ) + project_url = f'https://chameleoncloud.org{reverse("projects:view_project", args=[alloc.project.id])}' docs_url = ( "https://chameleoncloud.readthedocs.io/en/latest/user/project.html" "#recharge-or-extend-your-allocation " ) email_body = f"""

- The allocation for project {charge_code} + The allocation for project {charge_code} will expire {time_description}. See our Documentation on how to recharge or extend your allocation.