Configurable database email, local Mailgun sandbox

This commit is contained in:
Carl van Tonder 2018-04-04 13:36:27 -04:00
parent f19f501684
commit a50c40e739
2 changed files with 5 additions and 3 deletions

View File

@ -44,7 +44,7 @@ class BaseForm(LoginRequiredMixin, CreateView):
reverse('admin:map_casestudy_change', args=[self.object.id])
),
'noreply@ojuso.org',
['database@ojuso.org'],
[settings.DATABASE_EMAIL],
fail_silently=False,
)

View File

@ -118,10 +118,12 @@ EMAIL_USE_TLS = bool(int(os.getenv('EMAIL_USE_TLS', False)))
EMAIL_SUBJECT_PREFIX = "Ojuso Platform"
SERVER_EMAIL = os.getenv('SERVER_EMAIL', 'root@localhost')
DATABASE_EMAIL = os.getenv('DATABASE_EMAIL', 'autonomic-coop@posteo.net')
EMAIL_BACKEND = "anymail.backends.mailgun.EmailBackend"
ANYMAIL = {
"MAILGUN_API_KEY": os.getenv("MAILGUN_API_KEY", ""),
"MAILGUN_SENDER_DOMAIN": os.getenv("MAILGUN_SENDER_DOMAIN", ""),
"MAILGUN_API_KEY": os.getenv("MAILGUN_API_KEY", "key-e82f77942478d2892b4faf51fc88ce45"),
"MAILGUN_SENDER_DOMAIN": os.getenv("MAILGUN_SENDER_DOMAIN", "sandbox35a5ee2a4dfc4f3aaf76d4672e4497ae.mailgun.org"),
}