aboutsummaryrefslogtreecommitdiff
path: root/users/forms.py
diff options
context:
space:
mode:
authorBobby <[email protected]>2023-01-21 21:30:25 -0500
committerBobby <[email protected]>2023-01-21 21:30:25 -0500
commit2ec768c7964e82863a85ca3a15ce4bfefb2129de (patch)
tree9ef75d96ce029f9fe4393385f175cc58c6a3f19a /users/forms.py
parent2f5cb0fe049353f51ea1b1ac1f448fce7a62014f (diff)
downloadthatcomputerscientist-2ec768c7964e82863a85ca3a15ce4bfefb2129de.tar.xz
thatcomputerscientist-2ec768c7964e82863a85ca3a15ce4bfefb2129de.zip
Configure Oracle Cloud Email Delivery
Diffstat (limited to 'users/forms.py')
-rw-r--r--users/forms.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/users/forms.py b/users/forms.py
index 43b9230a..8593a605 100644
--- a/users/forms.py
+++ b/users/forms.py
@@ -3,13 +3,13 @@
from django import forms
from django.contrib.auth.models import User
from users.models import UserProfile
-from django.core.mail import send_mail
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.html import strip_tags
from django.utils.encoding import force_bytes
from django.utils.http import urlsafe_base64_encode
from .tokens import account_activation_token
+from .mail_send import send_email
class RegisterForm(forms.Form):
username = forms.CharField(label='Username', max_length=30, min_length=4)
@@ -63,9 +63,11 @@ class RegisterForm(forms.Form):
'domain': request.get_host(),
})
message = strip_tags(message)
- send_mail(subject, message, 'That Computer Scientist <' + settings.EMAIL_HOST_USER + '>', [user.email], fail_silently=False)
-
- return user
+ # send_mail(subject, message, 'That Computer Scientist <' + settings.EMAIL_HOST_USER + '>', [user.email], fail_silently=False)
+ if (send_email(sender='[email protected]', sender_name='That Computer Scientist', recipient=user.email, subject=subject, body_html=message, body_text=message)):
+ return user
+ else:
+ return user
class UpdateUserDetailsForm(forms.Form):
first_name = forms.CharField(label='First name', max_length=30, required=False, widget=forms.TextInput(attrs={'placeholder': 'First name'}))