Skip to content

Commit 18c5bd6

Browse files
feat: add datetime to email subject
1 parent 8580796 commit 18c5bd6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

oc4ids_datastore_pipeline/notifications.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ def _send_email(errors: list[dict[str, str]]) -> None:
2121
context = ssl.create_default_context()
2222
server.starttls(context=context)
2323
message = MIMEMultipart()
24-
message["Subject"] = "Errors in OC4IDS Datastore Pipeline run"
24+
current_time = datetime.datetime.now(datetime.UTC)
25+
message["Subject"] = f"Errors in OC4IDS Datastore Pipeline run: {current_time}"
2526
message["From"] = SENDER_EMAIL
2627
message["To"] = RECEIVER_EMAIL
2728

2829
html = f"""\
2930
<h1>Errors in OC4IDS Datastore Pipeline run</h1>
30-
<p>The pipeline completed at {datetime.datetime.now(datetime.UTC)}.</p>
31+
<p>The pipeline completed at {current_time}.</p>
3132
<p>Please see errors for each dataset below:</p>
3233
{"".join([
3334
f"""

0 commit comments

Comments
 (0)