fix: email from

This commit is contained in:
Silver Ghost 2022-10-25 18:04:25 +03:00
parent 6c7ae3b885
commit 2dfb338133
No known key found for this signature in database
2 changed files with 4 additions and 1 deletions

View File

@ -167,3 +167,4 @@ EMAIL_HOST = os.getenv('EMAIL_HOST', 'smtp')
EMAIL_HOST_USER = os.getenv('EMAIL_HOST_USER', None)
EMAIL_HOST_PASSWORD = os.getenv('EMAIL_HOST_PASSWORD', None)
EMAIL_PORT = os.getenv('EMAIL_PORT', '25')
EMAIL_FROM = os.getenv('EMAIL_FROM', 'noreply@later42.com')

View File

@ -5,6 +5,7 @@ from django.template.loader import render_to_string
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
from django.utils.encoding import force_bytes, force_text
from django.core.mail import EmailMessage
from django.conf import settings
from later42.forms import SignUpForm
from later42.tokens import account_activation_token
@ -33,7 +34,8 @@ def register(request):
})
to_email = form.cleaned_data.get('email')
email = EmailMessage(
mail_subject, message, to=[to_email]
mail_subject, message, to=[
to_email], from_email=settings.EMAIL_FROM
)
email.send()