Skip to content

Commit 77b2304

Browse files
authored
Merge pull request #567 from artoonie/leave-sendgrid
switch from sendgrid to generic smtp host
2 parents 1beb2b6 + 637bf5b commit 77b2304

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

app.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,20 @@
5656
"required": false
5757
},
5858

59-
"SENDGRID_USERNAME": {
60-
"description": "sendgrid username - required in prod to send user registration emails",
59+
"SMTP_HOST": {
60+
"description": "smtp host - required in prod to send user registration emails",
6161
"required": false
6262
},
63-
"SENDGRID_PASSWORD": {
64-
"description": "sendgrid password - required in prod to send user registration emails",
63+
"SMTP_PORT": {
64+
"description": "smtp port - required in prod to send user registration emails",
65+
"required": false
66+
},
67+
"SMTP_USERNAME": {
68+
"description": "smtp username - required in prod to send user registration emails",
69+
"required": false
70+
},
71+
"SMTP_PASSWORD": {
72+
"description": "smtp password - required in prod to send user registration emails",
6573
"required": false
6674
}
6775
},

infra/.env.template

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ export OFFLINE_ADMIN='name@domain.com'
2626
# export AWS_SECRET_ACCESS_KEY=''
2727

2828
# To send registration emails when OFFLINE_MODE is False:
29-
# export SENDGRID_USERNAME=''
30-
# export SENDGRID_PASSWORD=''
29+
# export SMTP_HOST='smtp.mailgun.org'
30+
# export SMTP_PORT=587
31+
# export SMTP_USERNAME=''
32+
# export SMTP_PASSWORD=''
3133

3234
# To clear cloudflare cache when models update:
3335
# export CLOUDFLARE_ZONE_ID=''

rcvis/settings.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@
133133
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
134134
else:
135135
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
136-
EMAIL_HOST = 'smtp.sendgrid.net'
137-
EMAIL_HOST_USER = os.environ.get('SENDGRID_USERNAME')
138-
EMAIL_HOST_PASSWORD = os.environ.get('SENDGRID_PASSWORD')
139-
EMAIL_PORT = 587
136+
EMAIL_HOST = os.environ.get('SMTP_HOST')
137+
EMAIL_HOST_USER = os.environ.get('SMTP_USERNAME')
138+
EMAIL_HOST_PASSWORD = os.environ.get('SMTP_PASSWORD')
139+
EMAIL_PORT = os.environ.get('SMTP_PORT')
140140
EMAIL_USE_TLS = True
141141
DEFAULT_FROM_EMAIL = 'team@rcvis.com'
142142

0 commit comments

Comments
 (0)