Skip to content

Commit a93fea7

Browse files
committed
Add url in template to send_email
1 parent 2e1cac6 commit a93fea7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/coldfront_plugin_cloud/management/commands/fetch_daily_billable_usage.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,15 @@
4646
)
4747
S3_BUCKET = os.getenv("S3_INVOICING_BUCKET", "nerc-invoicing")
4848

49+
CENTER_BASE_URL = import_from_settings("CENTER_BASE_URL")
4950
EMAIL_SENDER = import_from_settings("EMAIL_SENDER")
5051
EMAIL_ENABLED = import_from_settings("EMAIL_ENABLED")
5152
EMAIL_TEMPLATE = """Dear New England Research Cloud user,
5253
5354
Your {resource.name} {resource.type} Allocation in project {allocation.project.title} has reached your preset Alert value.
5455
5556
- As of midnight last night, your Allocation reached or exceeded your preset Alert value of {alert_value}.
56-
- To view your Allocation information visit {url}
57+
- To view your Allocation information visit {CENTER_BASE_URL}/allocations/{allocation.id}
5758
5859
Thank you,
5960
New England Research Cloud (NERC)
@@ -276,7 +277,7 @@ def handle_alerting(
276277
)
277278

278279
@staticmethod
279-
def send_alert_email(allocation, resource, alert_value):
280+
def send_alert_email(allocation: Allocation, resource: Resource, alert_value):
280281
mail.send_mail(
281282
subject="Allocation Usage Alert",
282283
message=EMAIL_TEMPLATE.format(

0 commit comments

Comments
 (0)