Update log.py

This commit is contained in:
The-Dark-Mode
2024-12-07 13:43:19 +13:00
committed by GitHub
parent bd5f7938d6
commit bfbf6deb94

4
log.py
View File

@ -45,14 +45,14 @@ event_cache = {}
# Function to send email with attachment and clip link # Function to send email with attachment and clip link
def send_email(message, snapshot_urls, event_label, clip_url): def send_email(message, snapshot_urls, event_label, clip_url):
try: try:
subject = f"Object Detected: {event_label}" subject = f"(Test) {event_label} detected!"
msg = MIMEMultipart() msg = MIMEMultipart()
msg['Subject'] = subject msg['Subject'] = subject
msg['From'] = EMAIL_FROM msg['From'] = EMAIL_FROM
msg['To'] = ", ".join(EMAIL_TO) msg['To'] = ", ".join(EMAIL_TO)
# Add the email body # Add the email body
body = f"{message}\n\n(Test) An object was detected at the Gate!\n\nClip link: {clip_url}" body = f"{message}\n\nClip: {clip_url}"
msg.attach(MIMEText(body)) msg.attach(MIMEText(body))
# Attach snapshots to the email # Attach snapshots to the email