Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User notification mail #12

Open
mkristofic opened this issue Jan 4, 2020 · 2 comments
Open

User notification mail #12

mkristofic opened this issue Jan 4, 2020 · 2 comments
Assignees

Comments

@mkristofic
Copy link
Collaborator

On the server side implement email sending to the user if detection has occurred on the camera. User should get the following info:

  • date and time when did the detection occurred
  • picture in which the face was detected

Send the email to your own email address or make a new email address for this purpose.

@mkristofic mkristofic self-assigned this Jan 4, 2020
@mkristofic
Copy link
Collaborator Author

Started implementing mail notifications.

  • Tested sending via local SMTP server -> local server did detect that e-mail has been sent, but the receiver did not receive the message.
  • Used gmail's SMTP server (smtp.gmail.com:587)
    • Opened a new gmail account with the address sissurvailance@gmail.com (a disaster of a name)
    • Started sending emails from the created email address - this works, see image attached

For that reason, EmailSender class was created with send_email(receiver_mail) method that writes the image from the camera data to the /tmp folder, sets the attachment of the mail and sends it to the receiver.


image

@mkristofic
Copy link
Collaborator Author

Update.

Added the time of the photo, see image attached.


image

mkristofic added a commit that referenced this issue Jan 5, 2020
EmailSender class was created which sends the image to the given receiver. The class constructor receives the camera number and data from the camera in byte format, saves the image to temp folder and sends an email with the image as attachment.
Until a better solution is found, the email is sent from newly created gmail account and through gmail's SMTP server.
mkristofic added a commit that referenced this issue Jan 7, 2020
Changed the name of the image to indicate the date and time of the image.
kcuric added a commit that referenced this issue Jan 7, 2020
Due to version issues syntax for string formating has been downgraded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant