Skip to content

Commit

Permalink
Add project link in renewal email
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Powers committed Dec 2, 2024
1 parent 8186793 commit 9b1866a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion allocations/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"""
<p>
The allocation for project <b>{charge_code}</b>
The allocation for project <a href="{project_url}"><b>{charge_code}</b></a>
will expire <b>{time_description}.</b> See our
<a href={docs_url}>Documentation</a>
on how to recharge or extend your allocation.
Expand Down

0 comments on commit 9b1866a

Please sign in to comment.