Skip to content

P1.7 - Implement Email Notifications #18

@Virgo-Alpha

Description

@Virgo-Alpha

Description

Notify the user via email when their scan job is complete. The implementation must handle different environments, sending real emails in production but printing to the console during development and testing to avoid spam and reliance on a real SMTP server.

Tasks:

  • Configure Django's email settings. Use environment variables to switch between django.core.mail.backends.smtp.EmailBackend for production and django.core.mail.backends.console.EmailBackend for development (DEBUG=True).
  • At the end of the perform_scan_task Celery task, add logic to call Django's send_mail function.
  • The email should inform the user that their scan for a specific company is complete and include a link to the results page.
  • Implement the reset password logic (from login)
  • Write unit tests (scans/tests/test_notifications.py). Use mock to assert that send_mail is called with the correct subject, message, and recipient email address, without actually sending an email.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions