Update main.py

This commit is contained in:
The-Dark-Mode
2024-12-07 13:42:37 +13:00
committed by GitHub
parent c7e305283e
commit bd5f7938d6

View File

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