enable setting SERVER_EMAIL from env, use DEFAULT_FROM_EMAIL for send_mail

From documentation for DEFAULT_FROM_EMAIL:

Default email address to use for various automated correspondence from the site manager(s).
This doesn’t include error messages sent to ADMINS and MANAGERS; for that, see SERVER_EMAIL.

That means it makes sense to make SERVER_EMAIL and DEFAULT_FROM_EMAIL separate settings and
not set one from another.
This commit is contained in:
clime
2019-02-10 19:36:43 +01:00
parent 4f06ccbb7b
commit 3fda33b6f6
2 changed files with 3 additions and 4 deletions

View File

@@ -31,7 +31,7 @@ from libravatar import libravatar_url
from ivatar.settings import MAX_LENGTH_EMAIL, logger
from ivatar.settings import MAX_PIXELS, AVATAR_MAX_SIZE, JPEG_QUALITY
from ivatar.settings import MAX_LENGTH_URL
from ivatar.settings import SECURE_BASE_URL, SITE_NAME, SERVER_EMAIL
from ivatar.settings import SECURE_BASE_URL, SITE_NAME, DEFAULT_FROM_EMAIL
from .gravatar import get_photo as get_gravatar_photo
@@ -383,7 +383,7 @@ class UnconfirmedEmail(BaseAccountModel):
# if settings.DEBUG:
# print('DEBUG: %s' % link)
send_mail(
email_subject, email_body, SERVER_EMAIL,
email_subject, email_body, DEFAULT_FROM_EMAIL,
[self.email])
return True