Skip to content

Notify Admin of New Account Requests -- Refs #13

This MR uses django-sendgrid to notify admin of the creation of new account requests.

Until #5 (closed) is totally resolved, some housekeeping is required for this to work well on one's local computer.

In particular, the following block has to be added to settings.py

# Email (SendGrid) settings
ADMIN_EMAIL = os.getenv("ADMIN_EMAIL")
if DEBUG:
    EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
else:
    EMAIL_BACKEND = "sendgrid_backend.SendgridBackend"
SENDGRID_API_KEY = os.getenv("SENDGRID_API_KEY")
SENDGRID_SANDBOX_MODE_IN_DEBUG = False
SENDGRID_ECHO_TO_STDOUT = True

And in INSTALLED_APPS the entry for 'core' has to be changed to 'core.apps.CoreConfig' so that signal handling works well.

A solution for #5 (closed) can build on the environment variable loading implemented here to move all secrets out of settings.py into .env. When that is done, the above blocks can be added to settings.py and committed to the remote.

Closes #13

Edited by mfonism

Merge request reports

Loading