Closed Ethra8 closed 5 hours ago
Issue has been reopened, because although it did send a confirmtion email via the terminal, the function to actully send real emails was not completed at all. Will get to it soon.
Email is sent:
This code has been added to settings.py:
if DEBUG == True:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
DEFAULT_FROM_EMAIL = 'englishgrows@example.com'
else:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD')
DEFAULT_FROM_EMAIL = os.environ.get('DEFAULT_FROM_EMAIL')
This way, when DEBUG is set to true during development fase, the console is used to receive sent emails, while being DEBUG set to false, the if statement will set the backend using smtp to send a real emal.
As a USER, I want to be able to receive an email confirmation after registering, so that I can verify that my account registration was successful