--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BOi5F31iuhtCDO63rPyt6nOXMY798fQgqorrY%3DwJxEcL36dNg%40mail.gmail.com.
# signup page
#
def signup_view(request):
if request.method == 'POST':
form = CustomerForm(request.POST)
if form.is_valid():
cust_item = form.cleaned_data
print(cust_item)
saveform = rim_customer(email=cust_item['email'],
reemail=cust_item['reemail'],
password=cust_item['password'],
repassword=cust_item['repassword'],
firstname=cust_item['firstname'],
state=cust_item['state'],
Zip=cust_item['Zip'],
cust_status='0',
mailing=cust_item['mailing'],
referred_by=cust_item['referred_by'])
saveform.save()
# Added the code for sending mail when a customer registered here EmailMessage is used from Django
activate = "<a href=" + url + "/Activate/" + str(saveform.id) + "> Click Here</a>"
sendMailStaus = EmailMessage('Registration Confirmation',
"<html>Thank you for registering with us!. You Activation is pending. Please " + activate + "</html>",
settings.EMAIL_HOST_USER,
[cust_item['email']])
sendMailStaus.content_subtype="html"
sendMailStaus.send()
form = CustomerForm()
return render(request, 'signup.html',{'form':form, 'success': 'mail succesfully send'})
else:
messages.error(request, form)
# return render(request,"form.html", {'error':error})
else:
form = CustomerForm()
return render(request, "signup.html", {'form': form})
# SiginUp_With_Transaction
def Popup_signup_view(request):
if request.method == 'POST':
form = CustomerForm(request.POST)
if form.is_valid():
cust_item = form.cleaned_data
saveform = rim_customer(email=cust_item['email'], reemail=cust_item['reemail'],
password=cust_item['password'], repassword=cust_item['repassword'],
firstname=cust_item['firstname'], state=cust_item['state'],
Zip=cust_item['Zip'], mailing=cust_item['mailing'], cust_status='0',
referred_by=cust_item['referred_by'])
saveform.save()
email = cust_item['email']
# noinspection PyUnresolvedReferences
sentMailStatus = sendEmail(email, request, saveform.id)
form = CustomerForm()
productid = request.POST['id']
result = transation_Cast(productid, email)
if sentMailStatus == True:
return HttpResponseRedirect(result)
else:
return HttpResponseRedirect(result)
else:
messages.error(request, form)
# return render(request,"form.html",{'error':error})
else:
form = CustomerForm()
return render(request, "signup.html", {'form': form})
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' # added by me
EMAIL_HOST = 'smtp.gmail.com'
#EMAIL_PORT = 465
EMAIL_USE_TLS = True
#EMAIL_USE_SSL = True
EMAIL_PORT = 587
EMAIL_HOST_USER = 'ad...@domain.com'
EMAIL_HOST_PASSWORD = 'domain@123456'
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACnTmkFeLgODmXog%2BJMbs_StRRt24Ux8JsLkx07qOpn_rt-JhA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BOi5F3apZBJaCgfsgq4xzjcDomNE%2BPVW-Vstvg1WJfxcw1PQA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAP5HUWqqccbfiAuCYu01uqgkYxpFw3oeD%3DM%3DMQjATRO4Cf1ZPw%40mail.gmail.com.