-
Notifications
You must be signed in to change notification settings - Fork 0
Issue 31 add email api and email configurations #51
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements email functionality for Issue #31, adding Django email configuration, a reusable email utility function, and updating environment variable templates. The implementation supports SMTP email sending with configurable backends.
Key changes:
- Email configuration added to Django settings with environment variable support
- Reusable
send_simple_email()utility function for sending emails - Comprehensive
.env.exampledocumentation for email setup with Gmail App Password guidance
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| server/requirements.txt | Complete dependencies list for the project |
| server/api/settings.py | Added email configuration section with SMTP settings and environment variable support |
| server/api/email_utils.py | New utility module with send_simple_email() wrapper function for Django's send_mail |
| server/.env.example | Updated with email configuration variables and developer setup instructions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ErikaKK
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got a few questions, will talk tomorrow
server/requirements.txt
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this. we are using poetry to manage dependencies
ErikaKK
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need a few changes, pls add html template for the email
server/.env.example
Outdated
| EMAIL_HOST_PASSWORD=your_app_password_here | ||
|
|
||
| EMAIL_USE_TLS=True | ||
| DEFAULT_FROM_EMAIL="Bloom Notifications <your_email@example.com>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like optional, so pls remove this, bc the title of the subject can tell it's bloom email
| from typing import Iterable | ||
|
|
||
|
|
||
| def send_simple_email( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
server/api/email_utils.py
Outdated
| Wrapper for Django's send_mail using DEFAULT_FROM_EMAIL. | ||
| """ | ||
| if from_email is None: | ||
| from_email = settings.DEFAULT_FROM_EMAIL or settings.EMAIL_HOST_USER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove settings.DEFAULT_FROM_EMAIL or
server/api/settings.py
Outdated
| EMAIL_USE_TLS = os.environ.get("EMAIL_USE_TLS", "True") == "True" | ||
| EMAIL_USE_SSL = os.environ.get("EMAIL_USE_SSL", "False") == "True" | ||
|
|
||
| DEFAULT_FROM_EMAIL = os.environ.get( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEFAULT_FROM_EMAIL = os.environ.get("EMAIL_HOST_USER", "")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't hard code, think about using a function and pass the details. pls use the bloom logo that you can find in figma thanks!









Change Summary
This PR implements the full backend email functionality for Issue #31.
It introduces Django email configuration, a reusable email utility function, and updates the environment variable template.
The integration was validated successfully by sending real test emails inside the DevContainer.
Change Form
The pull request title has an issue number
Includes:
issue-31-Add_email_API_and_email_configurationsThe change works by "Smoke testing" or quick testing
A real email was successfully sent using
send_simple_email()insidemanage.py shell, confirming Gmail App Password setup works.The change has tests
NA — No automated email tests added due to time constraints and because email sending typically requires mocking external SMTP servers.
The change has documentation
.env.exampleupdated to include required email environment variables and developer instructions.Other Information
settings.py(due to new S3 configuration frommain) were resolved cleanly.django-storages[boto3]to support new S3 backend introduced in main..envdatabase host to ensure backend starts correctly after merging latest main.Related issue