Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Use sendgrid when email_url doesn't exist
Adam Bogdała9ada6e9e926
diff --git a/saleor/settings.py b/saleor/settings.pyindex 2cf2549c97..3b099ef509 100644--- a/saleor/settings.py+++ b/saleor/settings.py@@ -43,14 +43,13 @@ USE_L10N = TrueUSE_TZ = True+EMAIL_URL = os.environ.get('EMAIL_URL')SENDGRID_USERNAME = os.environ.get('SENDGRID_USERNAME')SENDGRID_PASSWORD = os.environ.get('SENDGRID_PASSWORD')-if SENDGRID_USERNAME and SENDGRID_PASSWORD:+if not EMAIL_URL and SENDGRID_USERNAME and SENDGRID_PASSWORD:EMAIL_URL = 'smtp://%s:%[email protected]:587/?tls=True' % (SENDGRID_USERNAME, SENDGRID_PASSWORD)-else:- EMAIL_URL = os.environ.get('EMAIL_URL', 'console://')-email_config = dj_email_url.parse(EMAIL_URL)+email_config = dj_email_url.parse(EMAIL_URL or 'console://')EMAIL_FILE_PATH = email_config['EMAIL_FILE_PATH']EMAIL_HOST_USER = email_config['EMAIL_HOST_USER']