mail desde fromulario de contacto

This commit is contained in:
jp.av.dev 2020-11-15 03:46:07 -03:00
parent 9bef0a313e
commit 6dd7cb6f82

View File

@ -1,6 +1,8 @@
from django.shortcuts import render
from django.http import HttpResponse
from gestionPedidos.models import Articulos
from django.core.mail import send_mail
from django.conf import settings
# Create your views here.
def busqueda_productos(request):
@ -22,6 +24,11 @@ def buscar(request):
def contacto(request):
if request.method == "POST":
subject = request.POST['asunto']
message = request.POST['mensaje']+' '+request.POST['mail']
email_from = settings.EMAIL_HOST_USER
recipient_list = ['ratablastard@gmail.com']
send_mail(subject, message, email_from, recipient_list)
return render(request, "gracias.html")
return render(request, "contacto.html")