making app sendgrid compatible to circumvent ses

pull/3/head
lalanza808 5 years ago
parent 98a6d726f3
commit 4a3cfa4886

@ -18,3 +18,6 @@ DEBUG=true
# If no DEBUG # If no DEBUG
AWS_STORAGE_BUCKET_NAME=xxxxxxxxxxxxxx AWS_STORAGE_BUCKET_NAME=xxxxxxxxxxxxxx
AWS_S3_CUSTOM_DOMAIN=xxxxxxxxxxxxxxx AWS_S3_CUSTOM_DOMAIN=xxxxxxxxxxxxxxx
# Email
SENDGRID_API_KEY=xx

@ -2,6 +2,7 @@ Django==2.2.8
boto3==1.10.45 boto3==1.10.45
Pillow==6.2.1 Pillow==6.2.1
django-cors-headers==3.2.0 django-cors-headers==3.2.0
django-sendgrid-v5==0.8.1
django-redis==4.11.0 django-redis==4.11.0
django-registration==3.0.1 django-registration==3.0.1
django-storages==1.8.0 django-storages==1.8.0

@ -219,13 +219,17 @@ WALLET_PASS = os.environ.get('WALLET_PASS', '')
# Email info # Email info
EMAIL_BACKEND = os.environ.get('EMAIL_BACKEND', 'django.core.mail.backends.console.EmailBackend') DEFAULT_FROM_EMAIL = f'{SITE_NAME} <noreply@xmrauctions.com>'
EMAIL_FROM = 'noreply@xmrauctions.net' # EMAIL_HOST = os.environ.get('EMAIL_HOST', None)
EMAIL_HOST = os.environ.get('EMAIL_HOST', None) # EMAIL_PORT = os.environ.get('EMAIL_PORT', None)
EMAIL_PORT = os.environ.get('EMAIL_PORT', None) # EMAIL_USE_TLS = os.environ.get('EMAIL_USE_TLS', None)
EMAIL_USE_TLS = os.environ.get('EMAIL_USE_TLS', None) # EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER', None)
EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER', None) # EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD', None)
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD', None) SENDGRID_API_KEY = os.environ.get('SENDGRID_API_KEY', False)
if SENDGRID_API_KEY:
EMAIL_BACKEND = 'sendgrid_backend.SendgridBackend'
else:
EMAIL_BACKEND = os.environ.get('EMAIL_BACKEND', 'django.core.mail.backends.console.EmailBackend')
# CORS # CORS