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

Send email notifications to Project Creator and Drone Pilots #65

Merged
merged 15 commits into from
Jul 24, 2024

Conversation

nrjadkry
Copy link
Collaborator

@nrjadkry nrjadkry commented Jul 10, 2024

Description

The requirement is to send email notification to the project creators whenever a drone pilot requests to map a task and after the project creator accepts it, similar notification should be send to the drone pilot that his request has been accepted.

Package Used

I have used aiosmtplib package to send the email to the users

Tasks

  • SMTP Configurations
  • Utils functions to send the notifications
  • Email notification to the project creator
  • Email notification to the drone operators

@spwoodcock
Copy link
Member

spwoodcock commented Jul 21, 2024

python-emails isn't bad, but it hadn't been updated in a while.

With FastAPI ideally we want to use an async mailer to prevent thread blocking.

aoismtplib is good for this use case.
Example implementation using jinja templates (nice to see you are already using jinja):
https://gitlab.com/mastweb/backend/-/blob/main/app/api/user_public.py?ref_type=heads#L133

Note that either could work for now though if time is lacking. We can always refactor / replace in future.

@nrjadkry
Copy link
Collaborator Author

@spwoodcock We could use aoismtplib for async mailer. I was thinking of adding the email task into background task. Using async mailer sounds good

@nrjadkry nrjadkry self-assigned this Jul 23, 2024
@nrjadkry
Copy link
Collaborator Author

@spwoodcock I have updated this to use aiosmtp. Will you take a look into it.

@spwoodcock spwoodcock self-requested a review July 23, 2024 11:12
Copy link
Member

@spwoodcock spwoodcock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff 👍

@spwoodcock spwoodcock marked this pull request as ready for review July 23, 2024 11:14
@nrjadkry nrjadkry merged commit c0d6d8a into main Jul 24, 2024
0 of 2 checks passed
@nrjadkry nrjadkry deleted the email-notifications branch July 24, 2024 01:58
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

Successfully merging this pull request may close these issues.

2 participants