Skip to content

Commit

Permalink
#12 Changed syntax to the old syntax of string formating
Browse files Browse the repository at this point in the history
Due to version issues syntax for string formating has been downgraded.
  • Loading branch information
kcuric committed Jan 7, 2020
1 parent 3649bc7 commit a2ab39d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/modules/EmailSender.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def send_email(self, receiver_mail):
msg['From'] = sender
msg['To'] = receiver
msg['Subject'] = "Face detected"
body = f"At {date_and_time}, camera #{self.camera_num} detected a face. Find attached image with the detected face."
body = "At {}, camera #{} detected a face. Find attached image with the detected face.".format(date_and_time, self.camera_num)
msg.attach(MIMEText(body, 'plain'))

attachment = open(path, "rb")
Expand All @@ -50,6 +50,6 @@ def send_email(self, receiver_mail):
text = msg.as_string()
smtpObj.sendmail(sender, receiver, text)
smtpObj.quit()
print(f"Email sent to {receiver}.")
print("Email sent to {}.".format(receiver))
except Exception as e:
print("Unable to send the email.")

0 comments on commit a2ab39d

Please sign in to comment.