Update log.py
This commit is contained in:
4
log.py
4
log.py
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user