diff --git a/TiendaOnline/gestionPedidos/views.py b/TiendaOnline/gestionPedidos/views.py index 02f6c09..17a67de 100644 --- a/TiendaOnline/gestionPedidos/views.py +++ b/TiendaOnline/gestionPedidos/views.py @@ -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")